|
-
January 7th, 2000, 08:39 PM
#1
Spliting sentances
What I want to do is take a sentance- "Hello Bob" and split it letter-by-letter so
word(1)=H
word(2)=e
word(3)=l
word(4)=l
word(5)=o
word(6)=b (or blank for the space)
word(7)=o
word(8)=b
Can Anyone Help?
Thanks
-
January 7th, 2000, 08:43 PM
#2
Re: Spliting sentances
Create a string.
Fill the string with Your text: "Hello Bob"
Then use a do while loop to parse the string character by character setting your array equal each letter as it gets past. Look up the Left$ string function in your help and it should give you an idea of how things are done
-
January 9th, 2000, 12:04 PM
#3
Re: Spliting sentances
Hi !
Using the following code you can print a single letter from a word. To a new form add one command button and get it print to
the form.
Private Sub Command1_Click()
Dim strInput As String
Dim strWord(1 To 12) As String
Dim intLen As Integer
strInput = InputBox("Enter String")
intLen = Len(strInput)
For I = 1 To intLen Step 1
strWord(I) = Mid(strInput, I, 1)
'strInput = Mid(strInput, 1)
Form1.Print "strWord(" & I & ")=" & strWord(I)
Next I
End Sub
Satya N Chandu
E Mail Address : [email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|