| 34 | } |
| 35 | |
| 36 | std::string StringHandle::replace(std::string &s) |
| 37 | { |
| 38 | size_t i = 0,pos = std::string::npos; |
| 39 | std::string olds = "^#",news = "\\D"; |
| 40 | while((i = s.find_last_of(olds,pos)) != std::string::npos) |
| 41 | { |
| 42 | s = s.replace(i,news.length(),news); |
| 43 | pos = i - 1; |
| 44 | } |
| 45 | |
| 46 | olds = "#",news = "\\d"; |
| 47 | pos = std::string::npos; |
| 48 | while((i = s.find_last_of(olds,pos)) != std::string::npos) |
| 49 | { |
| 50 | s = s.replace(i,news.length(),news); |
| 51 | pos = i - 1; |
| 52 | } |
| 53 | return s; |
| 54 | } |
| 55 | |
| 56 | std::string StringHandle::StringUper(std::string str ) |
| 57 | { |
no outgoing calls
no test coverage detected