StringHelper Class

Helper functions for strings

Definition

Namespace: CoreMX.NET.Helpers
Assembly: CoreMX.NET (in CoreMX.NET.dll) Version: 1.0.0+7eb54d7f3459576d25646e9f286fb1fe49eac8a5
C#
public static class StringHelper
Inheritance
Object    StringHelper

Methods

Capitalize(String, Boolean) Capitalize the first letter of a word in strings
Capitalize(String, Int32, Boolean) Capitalize specific letters of a string
ChunkNameInParts Chunk a name into parts
EqualsIgnorecase Check if two strings are equal ignoring case
EscapeCharachters Escape characters in a string
EscapeRegexGroupName Escape a regex group name
EscapeRegexOperators Escape regex operators in a string
FormatName Format a name
FormatString Format a string with parameters (extension method for string.Format)
FromBase64String(Byte, Encoding) Convert a byte array to a Base64 string
FromBase64String(String, Encoding) Convert a Base64 string to a string
GetFirstName Get the first name from a full name
GetLastName Get the last name from a full name
GetRegexForSeparatorCharacter(Char, String) Creates a regex string for a separator character
GetRegexForSeparatorCharacter(String, String) Creates a regex string for a separator character
IsDecimal Checks if a string is a decimal
IsNumeric Checks if a string is only a number (int)
IsValidBase64String(String) Check if a Base64 string is valid
IsValidBase64String(String, Exception) Check if a Base64 string is valid
LimitCharacters Limit a string to a specific set of characters
PluralizeString Pluralize a string based on a count
Prefix Put a prefix in front of a string if it is not already there
PrefixSuffix Put a prefix and a suffix around a string if they are not already there
Replace Replace a string with predicates
ReplaceChars Replace non-allowed characters in a string
ReplaceFirst Replace the first occurence of a string
ReplaceIfCondition(String, String, String, Boolean) Replace a string if a condition is met
ReplaceIfCondition(String, String, String, FuncBoolean) Replace a string if a conditional function is met
SetNullIfEmpty Set a string to null if it is empty
Suffix Put a suffix at the end of a string if it is not already there
ToBase64String(Byte, Encoding) Convert a byte array to a Base64 string
ToBase64String(String, Encoding) Convert a string to a Base64 string
ToHexString(Byte) Convert a byte array to a hexadecimal string
ToHexString(Int32, Int16) Convert a int to a hexadecimal string
ToStringArray Convert a char array to a string array
ToVersionString Convert a double to a version string
Unescape Unescape a string

See Also