![]() |
1
5
拆分以下正则表达式:
它意味着匹配既没有前面也没有后面的分号的分号。 例如,此代码
生成以下输出: [entry] [entry2] [entry3] [entry4] [] 最后一个空字段是输入末尾分号的结果。
如果分号是
终止符
在每个字段的末尾,而不是在连续字段之间使用分隔符,然后使用
得到 [entry] [entry2] [entry3] [entry4] |
![]() |
2
1
为什么不使用
string sInput = "Entry1;entry2;entry3;entry4"; string[] sEntries = sInput.Split(';'); // Do what you have to do with the entries in the array... 希望这有帮助, 最好的问候, 汤姆。 |
![]() |
3
1
正如Tommieb75所写,您可以使用
结果将只包含以下4个元素:
|
![]() |
Emopusta · 从后端到前端的图像路径不工作 2 年前 |
![]() |
Asdrubal Hernandez · Linq查询特定数组索引出错 2 年前 |
![]() |
Niyazi Babayev · 如何在表达式中动态应用表达式? 2 年前 |
|
Dansih · .Net核心自定义身份验证方案 2 年前 |
![]() |
lolorekkk · 面板插入。NET WinForm 2 年前 |