1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

C#: Remove obsolete StringExtensions methods

This commit is contained in:
Raul Santos
2023-01-27 17:05:34 +01:00
parent 518b9e5801
commit 15066948d7

View File

@@ -68,19 +68,6 @@ namespace Godot
return string.Empty; return string.Empty;
} }
/// <summary>
/// Returns <see langword="true"/> if the strings begins
/// with the given string <paramref name="text"/>.
/// </summary>
/// <param name="instance">The string to check.</param>
/// <param name="text">The beginning string.</param>
/// <returns>If the string begins with the given string.</returns>
[Obsolete("Use string.StartsWith instead.")]
public static bool BeginsWith(this string instance, string text)
{
return instance.StartsWith(text);
}
/// <summary> /// <summary>
/// Returns the bigrams (pairs of consecutive letters) of this string. /// Returns the bigrams (pairs of consecutive letters) of this string.
/// </summary> /// </summary>
@@ -618,7 +605,7 @@ namespace Godot
} }
else else
{ {
if (instance.BeginsWith("/")) if (instance.StartsWith('/'))
{ {
rs = instance.Substring(1); rs = instance.Substring(1);
directory = "/"; directory = "/";
@@ -1198,23 +1185,6 @@ namespace Godot
return instance.Substring(0, pos); return instance.Substring(0, pos);
} }
/// <summary>
/// Returns a copy of the string with characters removed from the left.
/// The <paramref name="chars"/> argument is a string specifying the set of characters
/// to be removed.
/// Note: The <paramref name="chars"/> is not a prefix. See <see cref="TrimPrefix"/>
/// method that will remove a single prefix string rather than a set of characters.
/// </summary>
/// <seealso cref="RStrip(string, string)"/>
/// <param name="instance">The string to remove characters from.</param>
/// <param name="chars">The characters to be removed.</param>
/// <returns>A copy of the string with characters removed from the left.</returns>
[Obsolete("Use string.TrimStart instead.")]
public static string LStrip(this string instance, string chars)
{
return instance.TrimStart(chars.ToCharArray());
}
/// <summary> /// <summary>
/// Do a simple expression match, where '*' matches zero or more /// Do a simple expression match, where '*' matches zero or more
/// arbitrary characters and '?' matches any single character except '.'. /// arbitrary characters and '?' matches any single character except '.'.
@@ -1503,23 +1473,6 @@ namespace Godot
return instance.Substring(pos, instance.Length - pos); return instance.Substring(pos, instance.Length - pos);
} }
/// <summary>
/// Returns a copy of the string with characters removed from the right.
/// The <paramref name="chars"/> argument is a string specifying the set of characters
/// to be removed.
/// Note: The <paramref name="chars"/> is not a suffix. See <see cref="TrimSuffix"/>
/// method that will remove a single suffix string rather than a set of characters.
/// </summary>
/// <seealso cref="LStrip(string, string)"/>
/// <param name="instance">The string to remove characters from.</param>
/// <param name="chars">The characters to be removed.</param>
/// <returns>A copy of the string with characters removed from the right.</returns>
[Obsolete("Use string.TrimEnd instead.")]
public static string RStrip(this string instance, string chars)
{
return instance.TrimEnd(chars.ToCharArray());
}
/// <summary> /// <summary>
/// Returns the SHA-1 hash of the string as an array of bytes. /// Returns the SHA-1 hash of the string as an array of bytes.
/// </summary> /// </summary>