Filter Special Characters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ilikesuresh
    New Member
    • Aug 2007
    • 47

    Filter Special Characters

    Hi,
    I need a way to remove special characters in C.
    do you have any way other than checking ascii values?

    Please let me Know

    Thanks in advance
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    I would recommend starting by defining what a 'special' character is. Is it something you can type? Or something else?

    Comment

    • ilikesuresh
      New Member
      • Aug 2007
      • 47

      #3
      Originally posted by sicarie
      I would recommend starting by defining what a 'special' character is. Is it something you can type? Or something else?
      The characters other than [a-z] and [A-Z] are special characters right?
      I want to allow only these characters in my program. If you type other than this ,
      I need a way to find and filter or notify the user to type other than these characters

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        Originally posted by ilikesuresh
        The characters other than [a-z] and [A-Z] are special characters right?
        I want to allow only these characters in my program. If you type other than this ,
        I need a way to find and filter or notify the user to type other than these characters
        So a comma, period, or another form of punctuation are not special?

        In that case, I'd declare a char, read it in, and compare its value to see if it is in the range of a-z or A-Z.

        Comment

        Working...