get string between other string vb.net

前端 未结 4 1805
小鲜肉
小鲜肉 2021-01-19 15:32

I have code below. How do I get strings inside brackets? Thank you.

Dim tmpStr() As String
    Dim strSplit() As String
    Dim strReal As String
    Dim i A         


        
4条回答
  •  半阙折子戏
    2021-01-19 16:22

    1. Use String.IndexOf to get the position of the first opening bracket (x).

    2. Use IndexOf again the get the position of the first closing bracket (y).

    3. Use String.Substring to get the text based on the positions from x and y.

    4. Remove beginning of string up to y+1.

    5. Loop as required

    That should get you going.

提交回复
热议问题