Changeset 472 in dev for trunk/ab5.0/jenga/src/common/String.cpp
- Timestamp:
- Mar 31, 2008, 12:33:24 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/jenga/src/common/String.cpp
r465 r472 14 14 return false; 15 15 } 16 17 std::string& Jenga::Common::StringReplace( std::string& str, const std::string sb, const std::string sa ) 18 { 19 std::string::size_type n, nb = 0; 20 21 while ((n = str.find(sb,nb)) != std::string::npos) 22 { 23 str.replace(n,sb.size(),sa); 24 nb = n + sa.size(); 25 } 26 27 return str; 28 }
Note:
See TracChangeset
for help on using the changeset viewer.