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

Method rot13

source/core/StarString.cpp:273–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273String String::rot13() const {
274 String ret;
275 ret.reserve(m_string.length());
276 for (auto c : *this) {
277 if ((c >= 'a' && c <= 'm') || (c >= 'A' && c <= 'M'))
278 c += 13;
279 else if ((c >= 'n' && c <= 'z') || (c >= 'N' && c <= 'Z'))
280 c -= 13;
281 ret.append(c);
282 }
283 return ret;
284}
285
286StringList String::split(Char c, size_t maxSplit) const {
287 return split(String(c), maxSplit);

Callers 1

isProfaneMethod · 0.80

Calls 3

reserveMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected