| | |
string manipulation
![]() |
•
•
Join Date: Mar 2008
Posts: 26
Reputation:
Solved Threads: 0
•
•
•
•
hi.. i would like to save every word in the sentence separating by space " "...
any idea on it??
thxx
'set up an array to contain the words
Dim words(1 To 100) As String
'get the length of the sentence
sentencelength = Len(sentence)
'set a counter for the number of words
flag = 1
'a do loop to find the words
Do Until sentencelength = 0
'find the first space in the sentence
firstspace = InStr(sentence, " ")
'record the first word
words(flag) = Left(sentence, firstspace - 1)
'increment the word counter
flag = flag + 1
' knock the first word (and space) off sentence
sentence = Mid(sentence, firstspace + 1)
'get the new sentence length
sentencelength = Len(sentence)
Loop
Last edited by Bob Jacobs; Nov 10th, 2008 at 6:59 am.
![]() |
Similar Threads
- Help Please - with String Manipulation (C++)
- string manipulation (C)
- VBScript string Manipulation Help (ASP)
- C String Manipulation (C)
- Erroneus outputs in string manipulation simple program (C++)
- leak using c++ string (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How to do the encryption & decryption for text file
- Next Thread: Solved: VB 4/6 and volume labels
Views: 750 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add application banned basic beep beginner bmp box c++ calendar cd channel9 click coffeehouse column convert creative database datareport designer desktop dissertations dissertationthesis edit error excel filename filter flex form grid group header ide image implements inboxinvb installation installer keypress label list listbox listview machine macro mail match memory messagebox movingranges number open password pause pos powerpoint print printer program programmer query random range reading record refresh registration report reports retrieve save score search sites sound spectateswamp sql string sum table tags textbox time variable vb vb6 vb6.0 vba vista visual visualbasic web windows





