Add String.to_{camel,pascal,snake}_case methods

This commit is contained in:
Danil Alexeev
2022-08-30 12:36:24 +03:00
parent 432b25d364
commit d4555ef5fb
18 changed files with 234 additions and 88 deletions

View File

@@ -500,7 +500,7 @@ String RenameDialog::_postprocess(const String &subject) {
if (style_id == 1) {
// PascalCase to snake_case
result = result.camelcase_to_underscore(true);
result = result.to_snake_case();
result = _regex("_+", result, "_");
} else if (style_id == 2) {
@@ -521,7 +521,7 @@ String RenameDialog::_postprocess(const String &subject) {
end = start + 1;
}
buffer += result.substr(end, result.size() - (end + 1));
result = buffer.replace("_", "").capitalize();
result = buffer.to_pascal_case();
}
}