fork download
  1. Imports System
  2. Imports System.Text.RegularExpressions
  3.  
  4. Public Class Test
  5. Public Shared Sub Main()
  6. Dim text As String = "red 1 green 3 blue"
  7. Console.WriteLine(String.Join(";", Regex.Split(text, "red|green|blue")))
  8. 'Console.WriteLine(String.Join(";",
  9. ' Regex.Split(text, "red|green|blue").Where(Function(s) Not String.IsNullOrWhitespace(s))
  10. '))
  11. End Sub
  12. End Class
Success #stdin #stdout 0.05s 21096KB
stdin
Standard input is empty
stdout
; 1 ; 3 ;