MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / capitalize

Method capitalize

modules/gui/gui/src/backend/text_server/ustring.cpp:1204–1223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1202}
1203
1204String String::capitalize() const
1205{
1206 String aux = this->_camelcase_to_underscore().replace("_", " ").strip_edges();
1207 String cap;
1208 for (int i = 0; i < aux.get_slice_count(" "); i++)
1209 {
1210 String slice = aux.get_slicec(' ', i);
1211 if (slice.length() > 0)
1212 {
1213 slice[0] = _find_upper(slice[0]);
1214 if (i > 0)
1215 {
1216 cap += " ";
1217 }
1218 cap += slice;
1219 }
1220 }
1221
1222 return cap;
1223}
1224
1225String String::to_camel_case() const
1226{

Callers 1

to_pascal_caseMethod · 0.95

Calls 7

_find_upperFunction · 0.85
strip_edgesMethod · 0.80
get_slice_countMethod · 0.80
get_slicecMethod · 0.80
replaceMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected