Eg:
现在有一个字符串比如是string temp="aaa|bbb|ccc|";
请问如何分别得到aaa、bbb和ccc?
Ask:
.net中的做法
//把最后一个|去掉
string s= temp.Substring(0, temp.Length - 1);
通过|分割 保存在数组中
string[] arr = s.Split('|');
arr[0]就是字符串aaa
Eg:
现在有一个字符串比如是string temp="aaa|bbb|ccc|";
请问如何分别得到aaa、bbb和ccc?
Ask:
.net中的做法
//把最后一个|去掉
string s= temp.Substring(0, temp.Length - 1);
通过|分割 保存在数组中
string[] arr = s.Split('|');
arr[0]就是字符串aaa
转载于:https://my.oschina.net/sunrui9521/blog/12059