MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / titleCase

Method titleCase

source/core/StarString.cpp:210–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210String 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
224bool String::endsWith(String const& end, CaseSensitivity cs) const {
225 auto endsize = end.size();

Callers 3

processRuleMethod · 0.80
updateSpeciesMethod · 0.80

Calls 3

reserveMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected