I'm Trying to split delimited space and trim in vb.net.
Please Guide Me
Thanks
Module Module1
Sub Main()
Dim s As String = " 5010 2024-03-18 06:59:10 1 0 0 0"
Dim words As String() = s.Split(CType(vbTab, Char()))
For Each word As String In words
Console.WriteLine("WORD: {0}", word)
Next
Console.Read()
End Sub
End Module
output from above code
WORD: 5010
WORD: 2024-03-18 06:59:10
WORD: 1
WORD: 0
WORD: 0
WORD: 0
desired output
WORD: 5010
WORD: 2024-03-18
WORD: 06:59:10
WORD: 1
WORD: 0
WORD: 0
WORD: 0
according to recommendations from @Blackcat
and based on this link https://learn.microsoft.com/en-us/dotnet/api/system.string.split?view=net-8.0#system-string-split(system-char())
Output Result