Reputation: 157
The richtextbox1
contains 8 words "The brown fox jumped over the lazy dog". I want to copy the 5th word of the richtextbox1
to textbox1.text
when the button1
clicked.
can this be done using find method such as find(character, start integer, end integer)
etc ie. finding "empty" (space) character and read the characters until second "empty"(space) character found. or any other better method?
Upvotes: 1
Views: 65
Reputation: 59
You may also use the Mid function indeed. Chech it out from https://msdn.microsoft.com/en-us/library/05e63829(v=vs.90).aspx
Updated
textbox1.text = Mid(richtexbox1.text, 1, 5)
Upvotes: 1
Reputation: 158
I would suggest using the split function for this scenario. e.g
textbox1.text = richtextbox1.text.split(" ")(4) 'This is for the 5th word.
Upvotes: 1