VB.NET String.Split method?

后端 未结 1 1355
情歌与酒
情歌与酒 2020-12-20 15:39

I\'m having some issues using the String.Split method, Example here:

Dim tstString As String = \"something here -:- URLhere\"
Dim newtstString = tstString.Sp         


        
相关标签:
1条回答
  • 2020-12-20 16:19

    This is what you need to do, to prevent the string from being converted to a Char array.

        Dim text As String = "something here -:-  urlhere"
        Dim parts As String() = text.Split(New String() {" -:- "}, StringSplitOptions.None)
    

    This is the System.String member function you need to use in this case

    Public Function Split(ByVal separator As String(), ByVal options As StringSplitOptions) As String()
    
    0 讨论(0)
提交回复
热议问题