Add String::replace_char(s) methods for performance and convenience
This commit is contained in:
parent
c374ce211c
commit
889410dcda
67 changed files with 297 additions and 137 deletions
|
|
@ -478,7 +478,7 @@ void EditorPropertyOTVariation::update_property() {
|
|||
String name = TS->tag_to_name(name_tag);
|
||||
String name_cap;
|
||||
{
|
||||
String aux = name.replace("_", " ").strip_edges();
|
||||
String aux = name.replace_char('_', ' ').strip_edges();
|
||||
for (int j = 0; j < aux.get_slice_count(" "); j++) {
|
||||
String slice = aux.get_slicec(' ', j);
|
||||
if (slice.length() > 0) {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ void PluginConfigDialog::_on_required_text_changed() {
|
|||
}
|
||||
|
||||
String PluginConfigDialog::_get_subfolder() {
|
||||
return subfolder_edit->get_text().is_empty() ? name_edit->get_text().replace(" ", "_").to_lower() : subfolder_edit->get_text();
|
||||
return subfolder_edit->get_text().is_empty() ? name_edit->get_text().replace_char(' ', '_').to_lower() : subfolder_edit->get_text();
|
||||
}
|
||||
|
||||
String PluginConfigDialog::_to_absolute_plugin_path(const String &p_plugin_name) {
|
||||
|
|
|
|||
|
|
@ -1104,7 +1104,7 @@ void SpriteFramesEditor::_animation_name_edited() {
|
|||
new_name = "new_animation";
|
||||
}
|
||||
|
||||
new_name = new_name.replace("/", "_").replace(",", " ");
|
||||
new_name = new_name.replace_char('/', '_').replace_char(',', ' ');
|
||||
|
||||
String name = new_name;
|
||||
int counter = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue