读书人

取字符串有关问题

发布时间: 2011-12-13 21:22:18 作者: rapoo

取字符串问题,在线等
一个字符串,比如
string s = "123xxx456xxx789xxx ";

我要分别取123,456,789出来,应该怎么做?



[解决办法]
string[] ns=s.Replace( "xxx ", "x ").Split( 'x ');
[解决办法]
string[] ns=s.Replace(new char[ 'xxx ']);

读书人网 >C#

热点推荐