Merge pull request #38598 from neikeq/csharp-remove-stringextensions-empty
C#: Remove StringExtensions.Empty() function
This commit is contained in:
commit
4eb566c80c
1 changed files with 5 additions and 13 deletions
|
@ -12,7 +12,7 @@ namespace Godot
|
||||||
{
|
{
|
||||||
private static int GetSliceCount(this string instance, string splitter)
|
private static int GetSliceCount(this string instance, string splitter)
|
||||||
{
|
{
|
||||||
if (instance.Empty() || splitter.Empty())
|
if (string.IsNullOrEmpty(instance) || string.IsNullOrEmpty(splitter))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
|
@ -29,7 +29,7 @@ namespace Godot
|
||||||
|
|
||||||
private static string GetSliceCharacter(this string instance, char splitter, int slice)
|
private static string GetSliceCharacter(this string instance, char splitter, int slice)
|
||||||
{
|
{
|
||||||
if (!instance.Empty() && slice >= 0)
|
if (!string.IsNullOrEmpty(instance) && slice >= 0)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int prev = 0;
|
int prev = 0;
|
||||||
|
@ -237,10 +237,10 @@ namespace Godot
|
||||||
// </summary>
|
// </summary>
|
||||||
public static int CompareTo(this string instance, string to, bool caseSensitive = true)
|
public static int CompareTo(this string instance, string to, bool caseSensitive = true)
|
||||||
{
|
{
|
||||||
if (instance.Empty())
|
if (string.IsNullOrEmpty(instance))
|
||||||
return to.Empty() ? 0 : -1;
|
return string.IsNullOrEmpty(to) ? 0 : -1;
|
||||||
|
|
||||||
if (to.Empty())
|
if (string.IsNullOrEmpty(to))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
int instanceIndex = 0;
|
int instanceIndex = 0;
|
||||||
|
@ -286,14 +286,6 @@ namespace Godot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// <summary>
|
|
||||||
// Return true if the string is empty.
|
|
||||||
// </summary>
|
|
||||||
public static bool Empty(this string instance)
|
|
||||||
{
|
|
||||||
return string.IsNullOrEmpty(instance);
|
|
||||||
}
|
|
||||||
|
|
||||||
// <summary>
|
// <summary>
|
||||||
// Return true if the strings ends with the given string.
|
// Return true if the strings ends with the given string.
|
||||||
// </summary>
|
// </summary>
|
||||||
|
|
Loading…
Reference in a new issue