![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: May 2006
Location: Cambridge, UK
Posts: 60
Rep Power: 3
![]() |
Replacing characters in std::string
How can I easily replace characters in a std::string with another character?
Basically what I'd like is something like gsub (an addition to the string class in GNU's C++ class library). But I'm stuck on the Windows platform, and strongly encouraged to use the standard libraries as far as possible. ![]() First I tried using string::iterator and indexing, but got terribly long errors when doing that. Now my working solution is something like
Is there an easier way?
__________________
Don't comment bad code - rewrite it. - The Elements of Programming Style (Kernighan & Plaugher) |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Please Fix My Dll | Kilo | C++ | 12 | May 25th, 2006 12:21 PM |
| C# corruption!!! | Kilo | C++ | 32 | May 21st, 2006 9:44 PM |
| Testing for a palindrome using std::string | Jessehk | C++ | 9 | May 3rd, 2006 2:55 AM |
| 2 dimension array of characters | brad sue | C | 8 | Mar 15th, 2006 10:40 AM |
| Converting ANSI characters to hex for Checksum. | JawaKing00 | C | 4 | Sep 9th, 2005 6:07 AM |