如何使用System :: String ::拆分三个字符? [英] How to use System::String::Split with a split of three characters?
本文介绍了如何使用System :: String ::拆分三个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
也就是说,我想要按照三个空格的顺序分割,然后再用换行符分割。我尝试这样做,但它不工作:
namely, I want to split by a sequence of three white spaces, and then split again by a newline. I tried doing it, but it doesn't work:
array<wchar_t>^ separator = {' '};
array<String^>^ QandA = x->Split(separator );
任何人?
推荐答案
System.String.Split()包含一个将String数组作为分隔符的重载。所以使用一个元素/ n / r(或是它/ r / n ..我永远不会记得),并使用它作为您的分隔符。
System.String.Split() contains an overload that takes an array of String as a delimiter. So make a new array with the one element " /n/r" (or is it /r/n.. I can never remember), and use that as your delimiter.
这篇关于如何使用System :: String ::拆分三个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文