一个字符串的问题
现在有这种形式的字符串:WORD1-WORD2-WORD3
WORD是任意个字符,我想分别获取这三个,请问怎么实现?
也就是我想
string a = word1;
string b = word2;
string c = word3;
------解决方案--------------------string s = "WORD1-WORD2-WORD3 ";
string[] sl = s.Split( '- ');
string a = sl[0];
string b = sl[1];
string c = sl[2];