Retrieve a list of each word in a string- VB.NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

The following code retrieves every single word in a sentence or a paragraph and displays the words in a listbox

Dim words() As String

Dim space() As Char = {" "c}

words = TextBox1.Text.Split(space)

Dim word As String

For Each word In words

    ListBox1.Items.Add(word)

Next

Retrieve a list of each word in a string- VB.NET


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.