How to find substrings with single quotes in a string with VB.NET

1 Answer

0 votes
Imports System.Text.RegularExpressions

Module Module1

    Sub Main()

        Dim s As String = "java 'vb.net' python 'php' c++"
        Dim matchcollection As MatchCollection = Regex.Matches(s, "'(.*?)'")

        For Each mc As Match In matchcollection
            Dim g As Group = mc.Groups(1)
            Console.WriteLine(g.Value)
        Next

    End Sub

End Module


' run:
' 
' vb.net
' php

 



answered Oct 9, 2018 by avibootz

Related questions

1 answer 127 views
1 answer 191 views
1 answer 121 views
1 answer 126 views
...