vb.net 在VB.NET中用“”分割字符串
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11118896/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 16:10:05 来源:igfitidea点击:
Split string by " " in VB.NET
提问by BlackOpty
Let's say that this is my string:
假设这是我的字符串:
1 2 3
I want to split the string by " " (space) and display every time part of my string.
我想用“”(空格)分割字符串并每次显示我的字符串的一部分。
回答by nnm
This will do what you need:
这将做你需要的:
Dim str As String = "1 2 3"
Dim strarr() As String
strarr = str.Split(" "c)
For Each s As String In strarr
MessageBox.Show(s)
Next