Thread: removing characters from strings

  1. #1
    Registered User
    Join Date
    Feb 2003

    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 = 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.


  2. #2
    Registered User
    Join Date
    Nov 2002

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, 10:17 AM
  4. Removing spaces from strings
    By PunkyBunny300 in forum C Programming
    Replies: 6
    Last Post: 02-21-2003, 02:37 PM
  5. Scanning characters & strings
    By rain_e in forum C Programming
    Replies: 2
    Last Post: 03-04-2002, 01:43 AM