| 208 | } |
| 209 | |
| 210 | String String::titleCase() const { |
| 211 | String s; |
| 212 | s.reserve(m_string.length()); |
| 213 | bool capNext = true; |
| 214 | for (Char c : *this) { |
| 215 | if (capNext) |
| 216 | s.append(toUpper(c)); |
| 217 | else |
| 218 | s.append(toLower(c)); |
| 219 | capNext = !std::isalpha(c); |
| 220 | } |
| 221 | return s; |
| 222 | } |
| 223 | |
| 224 | bool String::endsWith(String const& end, CaseSensitivity cs) const { |
| 225 | auto endsize = end.size(); |
no test coverage detected