Splitting a string at all whitespace

前端 未结 7 2140
刺人心
刺人心 2021-01-17 11:06

I need to split a string at all whitespace, it should ONLY contain the words themselves.

How can I do this in vb.net?

Tabs, Newlines, etc. must all be split

7条回答
  •  无人及你
    2021-01-17 11:19

    Dim words As String = "This is a list of words, with: a bit of punctuation" + _
                              vbTab + "and a tab character." + vbNewLine
    Dim split As String() = words.Split(New [Char]() {" "c, CChar(vbTab), CChar(vbNewLine) })
    

提交回复
热议问题