We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,111 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Split sentences into words

Hi all,

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

Thank you.
Best regards

Eko

4
Contributors
4
Replies
3 Hours
Discussion Span
1 Year Ago
Last Updated
5
Views
Question
Answered
EkoX
Newbie Poster
20 posts since Aug 2008
Reputation Points: 28
Solved Threads: 1
Skill Endorsements: 0
thines01
Postaholic
Team Colleague
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7

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
Jx_Man
Senior Poster
3,529 posts since Nov 2007
Reputation Points: 1,488
Solved Threads: 521
Skill Endorsements: 64

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.

hkdani
Posting Pro in Training
439 posts since Nov 2007
Reputation Points: 61
Solved Threads: 48
Skill Endorsements: 2

Thank you all for helps..

EkoX
Newbie Poster
20 posts since Aug 2008
Reputation Points: 28
Solved Threads: 1
Skill Endorsements: 0
Question Answered as of 1 Year Ago by Jx_Man, thines01 and hkdani

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0667 seconds using 2.67MB