07/02/24 15:10:44
>>762
あんまり正規表現つかったことないんで間違ってたらごめん
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim texts As String() = MySplit(TextBox1.Text)
For Each Text As String In texts
Console.WriteLine(Text)
Next
End Sub
Private Function MySplit(ByVal input As String) As String()
Dim pattern As String = "([^,]*("".*"")+[^,]*,)|([^,]*,)|([^,]*$)"
Dim matches As MatchCollection = Regex.Matches(input, pattern)
Dim texts As New List(Of String)
For Each m As Match In matches
texts.Add(m.Value.Trim(","c))
Next
Return texts.ToArray
End Function