Skip to content

Extensions.String

Tomáš Bouda edited this page Nov 22, 2017 · 1 revision

🔴 Type Extensions.String.StringExtensions

Provides extension methods applied to String

🔹 Method Extensions.String.StringExtensions.Like(System.String,System.String)

"SQL" Like function with that works with wildcards

Param Description
toSearch
toFind

Returns:


🔹 Method Extensions.String.StringExtensions.FillIn(System.String,System.Object[])

String.Format shortcut

Param Description
s
args Arguments

Returns:


🔹 Method Extensions.String.StringExtensions.ToInt(System.String,System.Int32)

Converts given string to Int32 or returns defaultValue

Param Description
s
defaultValue

Returns:


🔹 Method Extensions.String.StringExtensions.ToIntN(System.String,System.Nullable{System.Int32})

Converts given string to Nullable Int32 or returns defaultValue

Param Description
s
defaultValue

Returns:


🔹 Method Extensions.String.StringExtensions.ToDouble(System.String,System.Double)

Converts given string to Double or returns defaultValue

Param Description
s
defaultValue

Returns:


🔹 Method Extensions.String.StringExtensions.ToFloat(System.String,System.Single)

Converts given string to Single or returns defaultValue

Param Description
s
defaultValue

Returns:


🔹 Method Extensions.String.StringExtensions.ToDate(System.String,System.DateTime)

Converts given string to DateTime or returns defaultValue

Param Description
s
defaultValue

Returns:


🔹 Method Extensions.String.StringExtensions.Parse``1(System.String)

Parse a string to any other type including nullable types using TypeConverter

Type Param Description
T
Param Description
value

Returns:


🔹 Method Extensions.String.StringExtensions.MaxLength(System.String,System.Int32,System.String)

Returns of given length. If length of given string is greater

Param Description
str
maxLenght
suffix

Returns:


🔹 Method Extensions.String.StringExtensions.BetweenChars(System.String,System.Char,System.Char)

Returns string located between two given characters

Param Description
str
first
last

Returns:


🔹 Method Extensions.String.StringExtensions.EndsWith(System.String,System.String[],System.String,System.Boolean)

Checks whether string ends with given sequence

Param Description
toSearch
extension
ignoreString
ignoreCase

Returns:


🔹 Method Extensions.String.StringExtensions.ToEnum``1(System.String,System.Boolean)

Converts string into enumerator of type T

Type Param Description
T
Param Description
value
ignoreCase

Returns:


🔹 Method Extensions.String.StringExtensions.IsValidUrl(System.String)

Determines whether given string is a valid URL.

Returns: true if is valid URL otherwise returns false.


🔹 Method Extensions.String.StringExtensions.IsValidEmailAddress(System.String)

Determines whether given string is a valid email address

Returns: true if is valid email address otherwise returns false.


🔹 Method Extensions.String.StringExtensions.IsFilled(System.String)

Inverse function of IsNullOrEmpty

Param Description
s

Returns:


🔹 Method Extensions.String.StringExtensions.ToUri(System.String)

Returns given string as Uri

Param Description
s

Returns:


🔹 Method Extensions.String.StringExtensions.IsNumber(System.String)

Returns true if given string is an Int32

Param Description
s

Returns:


🔹 Method Extensions.String.StringExtensions.CapitalizeSentence(System.String,System.String)

Capitalizes all words in a given sentence

Param Description
s
wordSeperator

Returns:


🔹 Method Extensions.String.StringExtensions.CapitalizeWord(System.String)

Capitalizes first character of given word

Param Description
s

Returns:


🔹 Method Extensions.String.StringExtensions.SplitRgx(System.String,System.String,System.Text.RegularExpressions.RegexOptions)

Shortcut for Split

Param Description
s
pattern
regexOptions

Returns:


🔹 Method Extensions.String.StringExtensions.ReplaceRgx(System.String,System.String,System.String,System.Text.RegularExpressions.RegexOptions)

Shortcut for Replace

Param Description
s
pattern
replacement
regexOptions

Returns:


🔹 Method Extensions.String.StringExtensions.RemoveWhitespaces(System.String)

Removes all whitespace char from given string using Replace

Param Description
s

Returns:


🔹 Method Extensions.String.StringExtensions.RemoveCZAccents(System.String)

Replaces Czech accents characters in given string with neutral characters

Param Description
s

Returns:


🔹 Method Extensions.String.StringExtensions.HtmlEncode(System.String)

Converts to a HTML-encoded string

Param Description
data The data.

Returns:


🔹 Method Extensions.String.StringExtensions.HtmlDecode(System.String)

Converts the HTML-encoded string into a decoded string


🔹 Method Extensions.String.StringExtensions.UrlEncode(System.String)

Encode an Url string


🔹 Method Extensions.String.StringExtensions.UrlDecode(System.String)

Converts a string that has been encoded for transmission in a URL into a decoded string.


Clone this wiki locally