Merge pull request #51009 from raulsntos/fix-csharp-split

Use `allowEmpty` parameter in Split
This commit is contained in:
Rémi Verschelde 2021-07-29 23:04:39 +02:00 committed by GitHub
commit bdcc8741e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1108,7 +1108,7 @@ namespace Godot
/// </summary> /// </summary>
public static string[] Split(this string instance, string divisor, bool allowEmpty = true) public static string[] Split(this string instance, string divisor, bool allowEmpty = true)
{ {
return instance.Split(new[] { divisor }, StringSplitOptions.RemoveEmptyEntries); return instance.Split(new[] { divisor }, allowEmpty ? StringSplitOptions.None : StringSplitOptions.RemoveEmptyEntries);
} }
/// <summary> /// <summary>