mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Replace find
with contains/has
where applicable
* Replaces `find(...) != -1` with `contains` for `String` * Replaces `find(...) == -1` with `!contains` for `String` * Replaces `find(...) != -1` with `has` for containers * Replaces `find(...) == -1` with `!has` for containers
This commit is contained in:
parent
281fe39929
commit
a0dbdcc3ab
55 changed files with 219 additions and 219 deletions
|
@ -3964,7 +3964,7 @@ String String::format(const Variant &values, const String &placeholder) const {
|
|||
Variant v_val = values_arr[i];
|
||||
String val = v_val;
|
||||
|
||||
if (placeholder.find("_") > -1) {
|
||||
if (placeholder.contains("_")) {
|
||||
new_string = new_string.replace(placeholder.replace("_", i_as_str), val);
|
||||
} else {
|
||||
new_string = new_string.replace_first(placeholder, val);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue