Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在字符“:”处拆分字符串,但无法从拆分中创建两个单独的字符串。如果有人可以帮助我,我将不胜感激。
在 RealBasic 中,Split方法不会创建两个(或更多)单独的字符串,而是创建一个字符串数组。
Dim s() As String = Split("Zero:One:Two", ":") 's() now contains the substrings like so: 's(0) = "Zero" 's(1) = "One" 's(2) = "Two"
实际上,代码不正确。它应该是:
Dim s() As String = Split("Zero:One:Two", ":")
如果您不传入分隔符,它会假定一个在这种情况下不起作用的空格。
在线文档位于http://docs.realsoftware.com/index.php/Split
Split is best for actually splitting the text, but you can also use the string-manipulation methods: Left, Right, Mid and InStr.