c# unity3d three ways to split and slice strings

textToSet=“(5/5 00:00, 131.85)”

method1:
string[] strArray = textToSet.Split(',');//拆分后strArray.count=2

method2:
string[] condition = {","};
string[] str = textToSet.Split(condition, StringSplitOptions.None);//拆分后strArray.count=2

method3:
string[] strArray2 = textToSet.Split(new char[3] {'(', ',', ')'});//拆分后strArray.count=4

Guess you like

Origin blog.csdn.net/luckydog1120446388/article/details/117554114