How to find the next word in a sub string
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 'String Manipulation - How to find the next word in a sub string Public Function FindNextWord(ByRef sText As String, ByRef sFind As String) As String Dim sWord() As String Dim lX As Long sWord = Split(sText, " ") For lX = 0 To UBound(sWord) If sWord(lX) = sFind Then If lX < UBound(sWord) Then FindNextWord = sWord(lX + 1) Exit For End If End If Next End Function |
Related posts:
- How to find the Length of the string
- How To Capitalize The First Character Of Each Word In A String/Phrase.
- How to Remove two or more hyphens from a string
- How to Replace Multiple Substrings in a String at Once
- How to check on which word the Mouse hover in Rich Text Box
- How to count number of words in a given string
- How to Scramble Word – Guaranteed different every time.
- How to Extract each and every word individually from a text file
- How to wrap words per line by number of characters (Word Wrap feature)
- How to Search for a word in a Text box.