Results 1 to 13 of 13

Thread: Looking For Letters In Strings

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Resolved Looking For Letters In Strings

    How do i check if a word contains two letters.
    VB Code:
    1. Public Sub DoItX(OldLetter As String, OldLetter1 As String, NewLetter As String, NewLetter1 As String)
    2.  
    3. Dim I As Integer
    4. Dim NewWord As String
    5.  
    6. For I = 0 To List1.ListCount - 1
    7. [COLOR=Red]    If InStr(LCase(List1.List(I)), OldLetter, OldLetter1) Then[/COLOR]
    8.         NewWord = List1.List(I)
    9.         NewWord = Replace(LCase(NewWord), OldLetter, NewLetter)
    10.         NewWord = Replace(LCase(NewWord), OldLetter1, NewLetter1)
    11.         List2.AddItem NewWord
    12.     End If
    13. Next
    14.  
    15. End Sub

    i tried that but it doesn't like the code in red.

    Anyone help ?
    Last edited by Ricky1; Sep 24th, 2005 at 07:45 AM.
    Im Learning !!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width