あなたが使用することができますString.Split
:
Dim words As String() = ConsoleInput.Text.Split({" "c}, StringSplitOptions.RemoveEmptyEntries)
If words.Length > 1 AndAlso words(0).ToLower() = "broadcast" Then
BroadcastMessage(words(1))
End If
編集:すべての単語をブロードキャストしたい場合は、以下を使用する方が良いかもしれませんString.Substring
:
Dim spaceIndex = ConsoleInput.Text.IndexOf(" "c)
If spaceIndex > -1 Then
Dim firstWord = ConsoleInput.Text.Substring(0, spaceIndex)
If firstWord.ToLower = "broadcast" Then
broadcast(ConsoleInput.Text.Substring(spaceIndex + 1))
End If
End If