mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
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
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue