|
-
April 20th, 2004, 02:13 PM
#1
std::map & std::string
I have a string that I need to replace key text with other text inside the string.
For example a I have a std::string with "There were 10 hours of work done over the past 18 weeks for the customer." I would like to change 10 to ten, 18 to eighteen, and customer to Something.com.
Currently I have a map with string pairs. One the text to search for and one for the replacement word.
My questions are, is using a std::map the best container for this? What is the fastest way (access time speed is the most important thing) to replace the text in the string? Token the string then search the map? Loop through the map and do a replace on the string?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|