Class StringControlExtensions
- Namespace
- HeroKit.Strings
- Assembly
- HeroKit.dll
Provides extension methods for string value checking and manipulation.
public static class StringControlExtensions
- Inheritance
-
StringControlExtensions
- Inherited Members
Methods
EqualsIgnoreCase(string?, string?, CultureInfo)
Compares two strings for equality, ignoring case with the rules of the given culture.
public static bool EqualsIgnoreCase(this string? value, string? other, CultureInfo culture)
Parameters
valuestringThe first string.
otherstringThe second string.
cultureCultureInfoThe culture whose casing rules are used. With tr-TR, "I" matches "ı" and "İ" matches "i".
Returns
- bool
True if both strings are null or equal ignoring case; otherwise false.
Examples
"IŞIK".EqualsIgnoreCase("ışık", CultureInfo.GetCultureInfo("tr-TR")); // true
"FILE".EqualsIgnoreCase("file", CultureInfo.InvariantCulture); // true
IsNotNullOrEmpty(string?)
Checks if the string is not null or empty.
public static bool IsNotNullOrEmpty(this string? value)
Parameters
valuestringThe string to check.
Returns
- bool
True if the string is not null or empty, false otherwise.
IsNotNullOrEmpty(string?, char)
Checks if the string is not null, empty, or consists only of the specified split value.
public static bool IsNotNullOrEmpty(this string? source, char splitValue)
Parameters
Returns
- bool
True if the string is not null, empty, or consists only of the split value, false otherwise.
IsNullOrEmpty(string?)
Checks if the string is null or empty.
public static bool IsNullOrEmpty(this string? value)
Parameters
valuestringThe string to check.
Returns
- bool
True if the string is null or empty, false otherwise.
IsNullOrEmpty(string?, char)
Checks if the string is null, empty, or consists only of the specified split value.
public static bool IsNullOrEmpty(this string? source, char splitValue)
Parameters
Returns
- bool
True if the string is null, empty, or consists only of the split value, false otherwise.