How can I get the characters between 2 other characters?

后端 未结 6 760
醉梦人生
醉梦人生 2020-12-20 15:57

I have a string which at some point contains the set of characters in the following format [123].

What I would like to do is get the characters between

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-20 16:32

    Dim s As String = "foo [123]=ro bar"
    Dim i As Integer = s.IndexOf("[")
    Dim f As String = s.Substring(i + 1, s.IndexOf("]", i + 1) - i - 1)
    

提交回复
热议问题