Method ExtString.Ends(+ 3 overloads)
Overload
Compares end of this string with other string. Returns true if equal.
public static bool Ends(this string t, ReadOnlySpan<char> s, bool ignoreCase = false)
Parameters
|
t (string)
This string. |
|
s (ReadOnlySpan<char>)
Other string. |
|
ignoreCase (bool)
Case-insensitive. |
Returns
Exceptions
|
ArgumentNullException
s is |
Remarks
Uses ordinal comparison (does not depend on current culture/locale).
Overload(next)
Compares end of this string with multiple strings. Returns 1-based index of the matching string, or 0 if none.
public static int Ends(this string t, bool ignoreCase, params ReadOnlySpan<string> strings)
Parameters
|
t (string)
This string. |
|
ignoreCase (bool)
Case-insensitive. |
|
strings (ReadOnlySpan<string>)
Other strings. |
Returns
Exceptions
|
ArgumentNullException
A string in strings is |
Remarks
Uses ordinal comparison (does not depend on current culture/locale).
Overload(next)
Returns true if this string ends with the specified character.
public static bool Ends(this string t, char c)
Parameters
Returns
Overload(top)
Returns true if starts with string s.
public static bool Ends(this ReadOnlySpan<char> t, ReadOnlySpan<char> s, bool ignoreCase = false)
Parameters
|
t (ReadOnlySpan<char>)
This span. |
|
s (ReadOnlySpan<char>)
Other string. |
|
ignoreCase (bool)
Case-insensitive. |
Returns
Remarks
Uses ordinal comparison (does not depend on current culture/locale).