C++ String Manipulation

Discussion in 'OT Technology' started by bStiffler582, Feb 25, 2007.

  1. bStiffler582

    bStiffler582 New Member

    Joined:
    Jul 3, 2005
    Messages:
    14
    Likes Received:
    0
    I need to remove a comma for an input string, using string operations only. I'm bad at string stuff, can anyone help?
     
  2. sonicsuby

    sonicsuby New Member

    Joined:
    Mar 15, 2000
    Messages:
    21,338
    Likes Received:
    0
    Location:
    CA
  3. samm

    samm Next in Line

    Joined:
    Dec 22, 2000
    Messages:
    2,630
    Likes Received:
    0
    Location:
    San Jose, CA
    use the std::string::find_first_of method

    Code:
    string foo("hello,world");
    string::size_type result = foo.find_first_of(",");
    
     

Share This Page