June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to analyze a string and retrieve a list of all the words it contains.
Use the String.Split method. Depending on the complexity of the task, you might need to take additional steps to remove unwanted words.
The String class includes a Split method that accepts an array of delimiter characters. The Split method divides the string every time one of these delimiters is found, and it returns the result as an array of strings. You can use this method with the space character to retrieve a list of words from a sentence.
Dim Sentence As String = "The quick brown fox jumps over the lazy dog." Dim Separators() As Char = {" "c} Dim Words() As String ' Split the sentence. Words = Sentence.Split(Separators) ...Read now
Unlock full access