1,105,534 Community Members

Split sentences into words

Member Avatar
EkoX
Newbie Poster
20 posts since Aug 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi all,

How i can split a sentences into words and add splitted words into listbox.

Thank you.
Best regards

Eko

Member Avatar
thines01
Postaholic
2,420 posts since Oct 2009
Reputation Points: 389 [?]
Q&As Helped to Solve: 413 [?]
Skill Endorsements: 10 [?]
Team Colleague
Featured
 
0
 
Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
2
 

See if this help :

Private Sub Command1_Click()
List1.Clear
x = 0
For j = 1 To Len(Trim(Text1.Text))
    kt1 = Mid(Trim(Text1.Text), j, 1)
    kta = kta + kt1
    If kt1 = Chr(32) Then
        x = x + 1
        List1.AddItem Trim(kta)
        kta = ""
    End If
Next j

If x >= 0 Then List1.AddItem Trim(kta)

End Sub
Member Avatar
hkdani
Posting Pro in Training
433 posts since Nov 2007
Reputation Points: 39 [?]
Q&As Helped to Solve: 46 [?]
Skill Endorsements: 2 [?]
 
0
 

How i can split a sentences into words and add splitted words into listbox.

You could try writing some code as is suggested for submitting requests in the guidelines.

But you could use the Mid function as indicated or you could use the Instr function. Search for the space character and declare a variable to return the value returned from your search. You'll use that value to start determine the word and also to determine the start point for the remaining portion of your search.

Member Avatar
EkoX
Newbie Poster
20 posts since Aug 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Thank you all for helps..

Question Answered as of 2 Years Ago by hkdani, Jx_Man and thines01
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: