CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2001
    Location
    South Korea
    Posts
    5

    Wildcards in Text files

    Hello again,

    Have another question. Does anyone know how to identify a normally wildcard character as "*" as part of a text line?

    For Example:
    Mid(strInput, 4, 5) <> "*" And ......

    When I really mean "*" and not just any character.


    Kathy DuBach at [email protected]

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Wildcards in Text files

    Just use the instr function

    if instr(mystring,"*") > 0 then
    ' the * is in the string
    else
    ' no * in the string
    end if




    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Apr 2001
    Location
    South Korea
    Posts
    5

    Re: Wildcards in Text files

    It worked! Thanks.
    If Mid(strInput, 1, 1) <> Chr(12) And _
    Mid(strInput, 1, 1) <> "" And _
    InStr(strInput, "*") = 0 And _
    Mid(strInput, 1, 6) <> "REPORT" And _

    I also found out by trial and error I could use
    Mid(strInput, 1, 1) <> ["*"] And _



    Kathy DuBach at [email protected]

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

Featured