C# Класс Utilities.Extensions.StringExtensions

Показать файл Открыть проект

Открытые методы

Метод Описание
AsciiToUnicode ( this asciiCode ) : string

Converts ASCII encoding to Unicode

Chop ( this text ) : string

Strips the last char from a a string.

Chop ( this text, int removeFromEnd ) : string

Strips the last specified chars from a string.

Chop ( this text, string backDownTo ) : string

Strips the last specified chars from a string.

Clip ( this text ) : string

Strips the last char from a a string.

Clip ( this text, int removeFromBeginning ) : string

Removes the specified chars from the beginning of a string.

Clip ( this text, string removeUpTo ) : string

Removes chars from the beginning of a string, up to the specified string

ContainsCaseInsensitive ( this text, string contains ) : bool

Validate that string contains string case insensitive search

Format ( this text ) : string

Formats the source text using the specified parameters

IsNotNullOrEmpty ( this text ) : bool

Verifies that the source text is not null or empty

IsNullOrEmpty ( this text ) : bool

Verifies that the source text is null or empty

IsSameAs ( this text, string match, System.StringComparison comparison = StringComparison.InvariantCultureIgnoreCase ) : bool

Verifies that the source text matches the specified match text using the provided comparison

MaxLength ( this text, int maxLength ) : string

Returns the start of the string up to the specified max length

NotSameAs ( this text, string match, System.StringComparison comparison = StringComparison.InvariantCultureIgnoreCase ) : bool

Verifies that the source text does not equal the specified value using the specified string comparison

RemoveTabs ( this text ) : string

Removes any tab spaces from the source text

SingleLine ( this text ) : string

Removes all line feeds, carriage returns and tab spaces from the source text

SplitLines ( this text, string delimiter = "\r\n" ) : string[]

Split the specified text into lines

StripHTML ( this htmlValue ) : string

Strips all HTML tags from a string

StripHTML ( this htmlValue, string htmlPlaceHolder ) : string

Strips all HTML tags from a string and replaces the tags with the specified replacement

TabsToSpaces ( this text, int spacesPerTab = 16 ) : string

Replaces the tabs in the source text with the specified number of spaces

TitleCase ( this text ) : string

Formats the source text as title case (i.e. "ChristopherJamesFairbairn" would become "Christopher James Fairbairn")

ToArray ( this source ) : string[]

Converts comma delimited string to array

ToArray ( this source, string delimiter ) : string[]

Converts delimited string to array by provided delimiter

ToICIC ( this text, string match ) : bool

Verifies that the source text matches the specified match text using StringComparison.InvariantCultureIgnoreCase

ToList ( this source ) : List

Converts comma delimited items of strings

ToList ( this source, string delimiter ) : List

Converts delimited string to items of strings by provided delimiter

ToUserName ( this source ) : string

Get a users username from a domain name string

Описание методов

AsciiToUnicode() публичный статический Метод

Converts ASCII encoding to Unicode
public static AsciiToUnicode ( this asciiCode ) : string
asciiCode this The ASCII code.
Результат string

Chop() публичный статический Метод

Strips the last char from a a string.
public static Chop ( this text ) : string
text this The source string.
Результат string

Chop() публичный статический Метод

Strips the last specified chars from a string.
public static Chop ( this text, int removeFromEnd ) : string
text this The source string.
removeFromEnd int The remove from end.
Результат string

Chop() публичный статический Метод

Strips the last specified chars from a string.
public static Chop ( this text, string backDownTo ) : string
text this The source string.
backDownTo string The back down to.
Результат string

Clip() публичный статический Метод

Strips the last char from a a string.
public static Clip ( this text ) : string
text this The source string.
Результат string

Clip() публичный статический Метод

Removes the specified chars from the beginning of a string.
public static Clip ( this text, int removeFromBeginning ) : string
text this The source string.
removeFromBeginning int The remove from beginning.
Результат string

Clip() публичный статический Метод

Removes chars from the beginning of a string, up to the specified string
public static Clip ( this text, string removeUpTo ) : string
text this The source string.
removeUpTo string The remove up to.
Результат string

ContainsCaseInsensitive() публичный статический Метод

Validate that string contains string case insensitive search
public static ContainsCaseInsensitive ( this text, string contains ) : bool
text this
contains string
Результат bool

Format() публичный статический Метод

Formats the source text using the specified parameters
public static Format ( this text ) : string
text this
Результат string

IsNotNullOrEmpty() публичный статический Метод

Verifies that the source text is not null or empty
public static IsNotNullOrEmpty ( this text ) : bool
text this
Результат bool

IsNullOrEmpty() публичный статический Метод

Verifies that the source text is null or empty
public static IsNullOrEmpty ( this text ) : bool
text this
Результат bool

IsSameAs() публичный статический Метод

Verifies that the source text matches the specified match text using the provided comparison
public static IsSameAs ( this text, string match, System.StringComparison comparison = StringComparison.InvariantCultureIgnoreCase ) : bool
text this
match string
comparison System.StringComparison
Результат bool

MaxLength() публичный статический Метод

Returns the start of the string up to the specified max length
public static MaxLength ( this text, int maxLength ) : string
text this
maxLength int
Результат string

NotSameAs() публичный статический Метод

Verifies that the source text does not equal the specified value using the specified string comparison
public static NotSameAs ( this text, string match, System.StringComparison comparison = StringComparison.InvariantCultureIgnoreCase ) : bool
text this
match string
comparison System.StringComparison
Результат bool

RemoveTabs() публичный статический Метод

Removes any tab spaces from the source text
public static RemoveTabs ( this text ) : string
text this
Результат string

SingleLine() публичный статический Метод

Removes all line feeds, carriage returns and tab spaces from the source text
public static SingleLine ( this text ) : string
text this
Результат string

SplitLines() публичный статический Метод

Split the specified text into lines
public static SplitLines ( this text, string delimiter = "\r\n" ) : string[]
text this
delimiter string
Результат string[]

StripHTML() публичный статический Метод

Strips all HTML tags from a string
public static StripHTML ( this htmlValue ) : string
htmlValue this The HTML string.
Результат string

StripHTML() публичный статический Метод

Strips all HTML tags from a string and replaces the tags with the specified replacement
public static StripHTML ( this htmlValue, string htmlPlaceHolder ) : string
htmlValue this The HTML string.
htmlPlaceHolder string The HTML place holder.
Результат string

TabsToSpaces() публичный статический Метод

Replaces the tabs in the source text with the specified number of spaces
public static TabsToSpaces ( this text, int spacesPerTab = 16 ) : string
text this
spacesPerTab int
Результат string

TitleCase() публичный статический Метод

Formats the source text as title case (i.e. "ChristopherJamesFairbairn" would become "Christopher James Fairbairn")
public static TitleCase ( this text ) : string
text this
Результат string

ToArray() публичный статический Метод

Converts comma delimited string to array
public static ToArray ( this source ) : string[]
source this
Результат string[]

ToArray() публичный статический Метод

Converts delimited string to array by provided delimiter
public static ToArray ( this source, string delimiter ) : string[]
source this
delimiter string
Результат string[]

ToICIC() публичный статический Метод

Verifies that the source text matches the specified match text using StringComparison.InvariantCultureIgnoreCase
public static ToICIC ( this text, string match ) : bool
text this
match string
Результат bool

ToList() публичный статический Метод

Converts comma delimited items of strings
public static ToList ( this source ) : List
source this
Результат List

ToList() публичный статический Метод

Converts delimited string to items of strings by provided delimiter
public static ToList ( this source, string delimiter ) : List
source this
delimiter string
Результат List

ToUserName() публичный статический Метод

Get a users username from a domain name string
public static ToUserName ( this source ) : string
source this
Результат string