Changeset 3327 for code/trunk/src/util
- Timestamp:
- Jul 19, 2009, 5:31:02 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core4 merged: 3269,3271-3275,3278,3285,3290-3294,3310
- Property svn:mergeinfo changed
-
code/trunk/src/util/StringUtils.cc
r3301 r3327 490 490 return std::string::npos; 491 491 } 492 493 /** 494 @brief Replaces individual charaters 495 @param str String to be manipulated 496 @param target Character to be replaced 497 @param replacement Replacement character 498 @return Number of replacements 499 */ 500 _UtilExport size_t replaceCharacters(std::string& str, char target, char replacement) 501 { 502 size_t j = 0; 503 for (size_t i = 0; i < str.size(); ++i) 504 { 505 if (str[i] == target) 506 { 507 str[i] = replacement; 508 ++j; 509 } 510 } 511 return j; 512 } 492 513 } -
code/trunk/src/util/StringUtils.h
r3280 r3327 77 77 _UtilExport size_t getCommentPosition(const std::string& str); 78 78 _UtilExport size_t getNextCommentPosition(const std::string& str, size_t start = 0); 79 80 _UtilExport size_t replaceCharacters(std::string& str, char target, char replacement); 79 81 } 80 82
Note: See TracChangeset
for help on using the changeset viewer.