Capturing alphabets from a string

This is a discussion on Capturing alphabets from a string within the C Programming forums, part of the General Programming Boards category; How do I extract only alphabets from a string and put them in a different string? Do I need to ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    23

    Capturing alphabets from a string

    How do I extract only alphabets from a string and put them in a different string? Do I need to use isalpha?

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231

    Re: Capturing alphabets from a string

    Originally posted by NavyBlue
    How do I extract only alphabets from a string and put them in a different string? Do I need to use isalpha?
    Yes, isalpha(), that'd be a good start . Have a go and post here with some code if you run into trouble.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    23
    How would I use isalpha? In a loop? I don't where to start with using isalpha to extract alphabets from a string.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    isalpha

    Loop through each character in the array, testing it with isalpha(). If the result is true, copy that one character to another array.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 07:02 AM
  2. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 01:56 PM
  3. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  4. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 02:45 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 07:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21