【发布时间】:2012-11-15 06:50:59
【问题描述】:
是否有一种简单的方法来执行 .Net 字符串 split() 函数,将原始拆分字符留在结果中?
这样:
"some text {that|or} another".Split('{','|','}');
会产生一个数组:
[0] = "some text "
[1] = "{"
[2] = "that"
[3] = "|"
...
最好没有正则表达式。
【问题讨论】:
-
stackoverflow.com/questions/2484919/… @TimSchmelter 并非所有这些答案都是正则表达式实现。
-
该链接的好解决方案.. thx