Split string by “ ” in VB.NET

前端 未结 1 1189
深忆病人
深忆病人 2021-01-18 07:42

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.

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 08:17

    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
    

    0 讨论(0)
提交回复
热议问题