You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-29 16:16:38 +00:00
Add String::replace_char(s) methods for performance and convenience
This commit is contained in:
@@ -103,7 +103,8 @@ const Vector<String> classes_with_csharp_differences = {
|
||||
};
|
||||
#endif
|
||||
|
||||
static const String nbsp = String::chr(160);
|
||||
static const char32_t nbsp_chr = 160;
|
||||
static const String nbsp = String::chr(nbsp_chr);
|
||||
static const String nbsp_equal_nbsp = nbsp + "=" + nbsp;
|
||||
static const String colon_nbsp = ":" + nbsp;
|
||||
|
||||
@@ -121,7 +122,7 @@ const Vector<String> packed_array_types = {
|
||||
};
|
||||
|
||||
static String _replace_nbsp_with_space(const String &p_string) {
|
||||
return p_string.replace(nbsp, " ");
|
||||
return p_string.replace_char(nbsp_chr, ' ');
|
||||
}
|
||||
|
||||
static String _fix_constant(const String &p_constant) {
|
||||
|
||||
Reference in New Issue
Block a user