blue220
asked on
LastWordTyped Function
Anyone know a function that will return the last word that is typed in a string regardless of where at in the string it's typed.
-------------------------- ---------- ---------- ---------- ---------- --
Example #1
String: "The boy walked to the store"
(
This should return the word store NOT because it's the last word in the sentence but because it's the last word that I typed.)
-------------------------- ---------- ---------- ---------- ---------- --
-------------------------- ---------- ---------- ---------- ---------- --
Example #2
String: "The boy walked to the store"
Then I change the word "boy" to "girl" in the sentence above so it looks like this.
"The girl walked to the store"
(This should return the word girl since it was the last word that was typed even though it's not the last word in the sentence)
-------------------------- ---------- ---------- ---------- ---------- --
I hope that makes sence and thanks for your replies in advance.
--------------------------
Example #1
String: "The boy walked to the store"
(
This should return the word store NOT because it's the last word in the sentence but because it's the last word that I typed.)
--------------------------
--------------------------
Example #2
String: "The boy walked to the store"
Then I change the word "boy" to "girl" in the sentence above so it looks like this.
"The girl walked to the store"
(This should return the word girl since it was the last word that was typed even though it's not the last word in the sentence)
--------------------------
I hope that makes sence and thanks for your replies in advance.
Where do you type the word? Is it in your application? If yes, is it in some single control or in a whole app?
ASKER
being a function I would expect it to work globally (atleast where you would expect type strings ie. in memos , edits , and richedits...) and yes it is in my app.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thx for the reply I have been busy working on this project and although your code will not really work for me this time I am sure I will find a use for it down the road so I will just award you the points for your effort.