程序代码: |
Dim s As String = "0,1,2,"
Dim res As String() = s.Split(New Char() {","}, StringSplitOptions.RemoveEmptyEntries)
Dim res1 As String() = s.Split(New Char() {","})
For Each str As String In res
MsgBox(str)
Next
MsgBox(res.Length)
For Each str As String In res1
MsgBox(str)
Next
MsgBox(res1.Length)
"0,1,2," split 之后为“0”、“1”、“2”、“”
使用,StringSplitOptions.RemoveEmptyEntries,可以清除最后一个“”空字符串
[本日志由 tiancao1001 于 2022-02-23 03:28 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! | |||
作者: | 用户: 密码: 注册? 验证: 防止恶意留言请输入问题答案:2*4=? | ||
评论:
禁止表情 禁止UBB 禁止图片 识别链接 识别关键字 |
|||