那么,我知道这可以是C#的非常基本的功能。 但我没有,因为这么多年问这个用....有比分割功能更简单的方法吗?
我有一个像MYNAME-1_1#字符串1233
我想仅从之间挑数字/字母 - ,_和#...
我可以使用拆分功能,但它需要相当大的代码...还有什么?
从弹弦的数字,我应该像下面的代码
string[] words = s.Split('-');
foreach (string word in words)
{
//getting two separate string and have to pick the number using index...
}
string[] words = s.Split('_');
foreach (string word in words)
{
//getting two separate string and have to pick the number using index...
}
string[] words = s.Split('#');
foreach (string word in words)
{
//getting two separate string and have to pick the number using index...
}
的输出是什么,你要 – Sajeetharan 2014-09-06 06:44:47
分割功能并不大。为什么不通过在您的问题中发布代码来向我们展示您的意思? – Enigmativity 2014-09-06 06:45:55
听起来像正规表达式的工作 – ne1410s 2014-09-06 06:46:21