You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix String.split() with empty string and delimeter
This commit is contained in:
@@ -1157,6 +1157,14 @@ Vector<String> String::split_spaces() const {
|
||||
|
||||
Vector<String> String::split(const String &p_splitter, bool p_allow_empty, int p_maxsplit) const {
|
||||
Vector<String> ret;
|
||||
|
||||
if (is_empty()) {
|
||||
if (p_allow_empty) {
|
||||
ret.push_back("");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int from = 0;
|
||||
int len = length();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user