fork(1) download
  1. Imports System
  2. Imports System.Text.RegularExpressions
  3.  
  4.  
  5. Public Class Test
  6. Public Shared Sub Main()
  7. Dim input As String = "ASD~QW~DFGH~LOP~GGGH~123~SXC~QL~"
  8.  
  9. Print(Split("asd"))
  10. Print(Split("asd~"))
  11. Print(Split("ASD~QW~DFGH~LOP~GGGH~123~SXC~QL~"))
  12. Print(Split("ASD~QW~DFGH~LOP~GGGH~123~SXC~QL~jones"))
  13. Console.WriteLine("....bye")
  14. End Sub
  15. Public Shared Sub Print(words As List(Of String))
  16. Console.WriteLine("Found {0} words", words.Count)
  17. For Each Val As String In words
  18. Console.Write(" [{0}]", Val)
  19. Next
  20. Console.WriteLine()
  21.  
  22. End Sub
  23. Public Shared Function Split(input As String) As List(Of String)
  24. Dim results = New List(Of String)
  25.  
  26. Dim pattern As String = ".*?~([^~]+?)(?=~)"
  27. Dim re As Regex = New Regex(pattern)
  28.  
  29. For Each mtch As Match In re.Matches(input)
  30. results.Add(mtch.Groups(1).Captures(0).Value)
  31. Next
  32. Return results
  33. End Function
  34. End Class
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.


/home/R42Oeh/prog.vb (15,54) : Error VBNC30451: Could not resolve the name 'List'
There were 1 errors and 0 warnings.
Compilation took 00:00:00.7200100
stdout
Standard output is empty