CodeItBetter Programming Another VB Programming Blog

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:

  1. How to find the Length of the string
  2. How To Capitalize The First Character Of Each Word In A String/Phrase.
  3. How to Remove two or more hyphens from a string
  4. How to Replace Multiple Substrings in a String at Once
  5. How to check on which word the Mouse hover in Rich Text Box
  6. How to count number of words in a given string
  7. How to Scramble Word – Guaranteed different every time.
  8. How to Extract each and every word individually from a text file
  9. How to wrap words per line by number of characters (Word Wrap feature)
  10. How to Search for a word in a Text box.

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.