Class StringUtility
Inheritance
StringUtility
Syntax
public static class StringUtility
Methods
AllIndexesOf(String, String)
Declaration
public static IEnumerable<int> AllIndexesOf(this string haystack, string needle)
Parameters
Returns
AppendLineFormat(StringBuilder, String, Object[])
Declaration
public static void AppendLineFormat(this StringBuilder sb, string format, params object[] args)
Parameters
Contains(String, Char)
Declaration
public static bool Contains(this string s, char c)
Parameters
Returns
ContainsInsensitive(String, String)
Declaration
public static bool ContainsInsensitive(this string haystack, string needle)
Parameters
Returns
CountIndices(String, Char)
Declaration
public static int CountIndices(this string s, char c)
Parameters
Returns
EndsWith(String, Char)
Declaration
public static bool EndsWith(this string s, char c)
Parameters
Returns
FallbackEmpty(String, String)
Declaration
public static string FallbackEmpty(string s, string fallback)
Parameters
Returns
FallbackWhitespace(String, String)
Declaration
public static string FallbackWhitespace(string s, string fallback)
Parameters
Returns
Filter(String, Boolean, Boolean, Boolean, Boolean, Boolean)
Declaration
public static string Filter(this string s, bool letters = true, bool numbers = true, bool whitespace = true, bool symbols = true, bool punctuation = true)
Parameters
Returns
FilterReplace(String, Char, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)
Declaration
public static string FilterReplace(this string s, char replacement, bool merge, bool letters = true, bool numbers = true, bool whitespace = true, bool symbols = true, bool punctuation = true)
Parameters
Returns
FirstCharacterToLower(String)
Declaration
public static string FirstCharacterToLower(this string s)
Parameters
Type |
Name |
Description |
String |
s |
|
Returns
FirstCharacterToUpper(String)
Declaration
public static string FirstCharacterToUpper(this string s)
Parameters
Type |
Name |
Description |
String |
s |
|
Returns
IsGuid(String)
Declaration
public static bool IsGuid(string value)
Parameters
Type |
Name |
Description |
String |
value |
|
Returns
IsNullOrWhiteSpace(String)
Declaration
public static bool IsNullOrWhiteSpace(string s)
Parameters
Type |
Name |
Description |
String |
s |
|
Returns
IsWordBeginning(Nullable<Char>, Char, Nullable<Char>)
Declaration
public static bool IsWordBeginning(char? previous, char current, char? next)
Parameters
Returns
IsWordBeginning(String, Int32)
Declaration
public static bool IsWordBeginning(string s, int index)
Parameters
Returns
IsWordDelimiter(Char)
Declaration
public static bool IsWordDelimiter(char c)
Parameters
Type |
Name |
Description |
Char |
c |
|
Returns
NullIfEmpty(String)
Declaration
public static string NullIfEmpty(this string s)
Parameters
Type |
Name |
Description |
String |
s |
|
Returns
PartAfter(String, Char)
Declaration
public static string PartAfter(this string s, char c)
Parameters
Returns
PartBefore(String, Char)
Declaration
public static string PartBefore(this string s, char c)
Parameters
Returns
PartsAround(String, Char, out String, out String)
Declaration
public static void PartsAround(this string s, char c, out string before, out string after)
Parameters
PathEllipsis(String, Int32)
Declaration
public static string PathEllipsis(string s, int maxLength)
Parameters
Returns
Prettify(String)
Declaration
public static string Prettify(this string s)
Parameters
Type |
Name |
Description |
String |
s |
|
Returns
RemoveConsecutiveCharacters(String, Char)
Declaration
public static string RemoveConsecutiveCharacters(this string s, char c)
Parameters
Returns
ReplaceMultiple(String, HashSet<Char>, Char)
Declaration
public static string ReplaceMultiple(this string s, HashSet<char> haystacks, char replacement)
Parameters
Returns
SplitWords(String, Char)
Declaration
public static string SplitWords(this string s, char separator)
Parameters
Returns
StartsWith(String, Char)
Declaration
public static bool StartsWith(this string s, char c)
Parameters
Returns
ToBinaryString(Enum)
Declaration
public static string ToBinaryString(this Enum value)
Parameters
Type |
Name |
Description |
Enum |
value |
|
Returns
ToBinaryString(Int32)
Declaration
public static string ToBinaryString(this int value)
Parameters
Type |
Name |
Description |
Int32 |
value |
|
Returns
ToBinaryString(Int64)
Declaration
public static string ToBinaryString(this long value)
Parameters
Type |
Name |
Description |
Int64 |
value |
|
Returns
ToCommaSeparatedString(IEnumerable)
Declaration
public static string ToCommaSeparatedString(this IEnumerable enumerable)
Parameters
Returns
ToHexString(Byte[])
Declaration
public static string ToHexString(this byte[] bytes)
Parameters
Type |
Name |
Description |
Byte[] |
bytes |
|
Returns
ToLineSeparatedString(IEnumerable)
Declaration
public static string ToLineSeparatedString(this IEnumerable enumerable)
Parameters
Returns
ToSeparatedString(IEnumerable, String)
Declaration
public static string ToSeparatedString(this IEnumerable enumerable, string separator)
Parameters
Returns
TrimEnd(String, String)
Declaration
public static string TrimEnd(this string source, string value)
Parameters
Returns
TrimStart(String, String)
Declaration
public static string TrimStart(this string source, string value)
Parameters
Returns
Truncate(String, Int32, String)
Declaration
public static string Truncate(this string value, int maxLength, string suffix = "...")
Parameters
Returns