removing characters from strings

This is a discussion on removing characters from strings within the C++ Programming forums, part of the General Programming Boards category; Im looking for an eloquent way (like something in the stl?) to do the following pseudocode: str1 = "hi im ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    265

    Post removing characters from strings

    Im looking for an eloquent way (like something in the stl?) to do the following pseudocode:

    str1 = "hi im sue. hi im joe!";
    str2;
    str2 = remove(".", str1);
    str2 = remove("!", str2);

    I figure somebody knows a better way of doing this than looping through and cating str1's desired characters onto str2. There has to be a nice function (probablly in the stl) that does exactly what im looking for.

    0x7F

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Check strings which should only contain some characters.
    By qingxing2005 in forum C Programming
    Replies: 2
    Last Post: 06-17-2008, 09:32 AM
  2. How do you check how many characters a user has entered?
    By engstudent363 in forum C Programming
    Replies: 5
    Last Post: 04-08-2008, 06:05 AM
  3. Converting C strings to list of characters
    By kazbo in forum C Programming
    Replies: 11
    Last Post: 02-14-2005, 09:17 AM
  4. Removing spaces from strings
    By PunkyBunny300 in forum C Programming
    Replies: 6
    Last Post: 02-21-2003, 01:37 PM
  5. Scanning characters & strings
    By rain_e in forum C Programming
    Replies: 2
    Last Post: 03-04-2002, 12:43 AM

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