How to VB.NET String.Split()
The VB.Net Split() extracts the substrings from the given string that are delimited by the separator parameter, and returns those substrings as elements of an array.
If your String contains "dd-mm-yy", split on the "-" character to get an array of: "dd" "mm" "yy".
If the separator parameter is null or contains no characters, white space characters are assumed to be the delimiters.
- separator - the given delimiter.
- An array of Strings delimited by one or more characters in separator.
VB.Net String Split Example
VB.Net String Split by multiple characters delimiter
We can split a string by multiple character delimiter using String.split() method.
Using Regular Expressions for multiple characters
VB.Net String Split by multiple characters delimiter using Regular Expressions
You should import System.Text.RegularExpressions in your project to run the following code
Split() a delimited string to a List < String > in VB.Net
You can retrieve the result of a String splt() method to a VB.Net List. The following program convert the String Array to a List.
VB.Net Convert List to String
VB.NetString split White spaces
StringSplitOptions.RemoveEmptyEntries guarantees the return value does not include array elements that contain an empty string. The following VB.Net program shows how to remove all white spaces from string using StringSplitOptions.RemoveEmptyEntries.
When you execute this VB.Net program you will get the result removing all white spaces from the string