我有一个字符串数组string[] arr
,其中包含N36102W114383
、N36102W114382
等值...
我想拆分每个字符串,使值像这样 N36082
和 W115080
。
执行此操作的最佳方法是什么?
最佳答案
这应该适合你。
Regex regexObj = new Regex(@"\w\d+"); # matches a character followed by a sequence of digits
Match matchResults = regexObj.Match(subjectString);
while (matchResults.Success) {
matchResults = matchResults.NextMatch(); #two mathches N36102 and W114383
}
关于c# - 拆分字符串数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8047240/