C# Класс Ext.Net.Utilities.StringUtils

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

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

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

Base64 string decoder

Base64Encode ( this text ) : string

Base64 string encoder

Chop ( this text ) : string

Chops one character from each end of string.

Chop ( this text, int characters ) : string

Chops the specified number of characters from each end of string.

Chop ( this text, string character ) : string

Chops the specified string from each end of the string. If the character does not exist on both ends of the string, the characters are not chopped.

ConcatWith ( this instance ) : string

Add the args strings the source text string.

ConcatWith ( this instance, string text ) : string

Add the text string to the source string.

Contains ( this instance ) : bool

Determines if the string contains any of the args. If yes, returns true, otherwise returns false.

Ellipsis ( this text, int length ) : string

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length

Ellipsis ( this text, int length, bool word ) : string

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length

Enquote ( this text ) : string

EnsureSemiColon ( this text ) : string

FormatRegexPattern ( this regex ) : string

FormatWith ( this format ) : string

Format the string with the args.

FormatWith ( this format, IFormatProvider provider ) : string

FormatWith ( this format, object source ) : string

If ( this text, string test, string valueIfTrue ) : string

IfNot ( this text, string test, string valueIfTrue ) : string

IsEmpty ( this text ) : bool

Determine is the string is null or empty.

IsLowerCamelCase ( this text ) : bool

IsNotEmpty ( this text ) : bool

Determine is the string is NOT null or empty.

Join ( this items ) : string

Join ( this items, string separator ) : string

Join ( this items, string separator, string template ) : string

Join the items together

LeftOf ( this text, char c ) : string

Left of the first occurance of c

LeftOf ( this text, char c, int n ) : string

Left of the n'th occurance of c

LeftOf ( this text, string value ) : string

Left of the first occurance of text

LeftOfRightmostOf ( this text, char c ) : string

LeftOfRightmostOf ( this text, string value ) : string

PadLeft ( this text, char c, Int32 totalLength ) : string

Pad the left side of a string with characters to make the total length.

PadRight ( this text ) : string

Pad the right side of a string with a '0' if a single character.

PadRight ( this text, char c, Int32 totalLength ) : string

Pad the right side of a string with characters to make the total length.

Randomize ( this chars ) : string

Randomize ( this chars, int length ) : string

Generate a random string of character at a certain length

ReplaceLastInstanceOf ( this text, string oldValue, string newValue ) : string

RightOf ( this text, char c ) : string

Right of the first occurance of c

RightOf ( this text, char c, int n ) : string

Right of the n'th occurance of c

RightOf ( this text, string value ) : string

Right of the first occurance of text

RightOf ( this text, string c, int n ) : string

Right of the n'th occurance of c

RightOfRightmostOf ( this text, char c ) : string

RightOfRightmostOf ( this text, string value ) : string

Test ( this text, string pattern ) : bool

Test ( this text, string pattern, RegexOptions options ) : bool

ToCamelCase ( this text ) : string

ToCamelCase ( this values, string separator ) : string

ToCharacterSeparatedFileName ( this name, char separator, string extension ) : string

Accepts a string like "ArrowRotateClockwise" and returns "arrow_rotate_clockwise.png".

ToLowerCamelCase ( this text ) : string

ToMD5Hash ( this text ) : string

MD5Hash's a string.

ToTitleCase ( this text ) : string

Converts the first character of each word to Uppercase. Example: "the lazy dog" returns "The Lazy Dog"

ToTitleCase ( this text, CultureInfo ci ) : string

Converts the first character of each word to Uppercase. Example: "the lazy dog" returns "The Lazy Dog"

Wrap ( this text, string wrapByText ) : string

Wrap ( this text, string wrapStart, string wrapEnd ) : string

Приватные методы

Метод Описание
Between ( this text, string start, string end ) : string
Eval ( object source, string expression ) : object

FormatWith ( this format, IFormatProvider provider, object source ) : string
Replace ( this instance, string oldValues, string>.Func convert ) : string
Replace ( this instance, string oldValues, string newValue ) : string
Subarray ( this items, int start ) : string[]
Subarray ( this items, int start, int length ) : string[]

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

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

Base64 string decoder
public static Base64Decode ( this text ) : string
text this The text string to decode
Результат string

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

Base64 string encoder
public static Base64Encode ( this text ) : string
text this The text string to encode
Результат string

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

Chops one character from each end of string.
public static Chop ( this text ) : string
text this
Результат string

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

Chops the specified number of characters from each end of string.
public static Chop ( this text, int characters ) : string
text this
characters int
Результат string

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

Chops the specified string from each end of the string. If the character does not exist on both ends of the string, the characters are not chopped.
public static Chop ( this text, string character ) : string
text this
character string
Результат string

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

Add the args strings the source text string.
public static ConcatWith ( this instance ) : string
instance this
Результат string

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

Add the text string to the source string.
public static ConcatWith ( this instance, string text ) : string
instance this
text string
Результат string

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

Determines if the string contains any of the args. If yes, returns true, otherwise returns false.
public static Contains ( this instance ) : bool
instance this The instance of the string
Результат bool

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

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length
public static Ellipsis ( this text, int length ) : string
text this The string to truncate
length int The maximum length to allow before truncating
Результат string

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

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length
public static Ellipsis ( this text, int length, bool word ) : string
text this The string to truncate
length int The maximum length to allow before truncating
word bool True to try to find a common work break
Результат string

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

public static Enquote ( this text ) : string
text this
Результат string

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

public static EnsureSemiColon ( this text ) : string
text this
Результат string

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

public static FormatRegexPattern ( this regex ) : string
regex this
Результат string

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

Format the string with the args.
public static FormatWith ( this format ) : string
format this
Результат string

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

public static FormatWith ( this format, IFormatProvider provider ) : string
format this
provider IFormatProvider
Результат string

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

public static FormatWith ( this format, object source ) : string
format this
source object
Результат string

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

public static If ( this text, string test, string valueIfTrue ) : string
text this
test string
valueIfTrue string
Результат string

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

public static IfNot ( this text, string test, string valueIfTrue ) : string
text this
test string
valueIfTrue string
Результат string

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

Determine is the string is null or empty.
public static IsEmpty ( this text ) : bool
text this
Результат bool

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

public static IsLowerCamelCase ( this text ) : bool
text this
Результат bool

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

Determine is the string is NOT null or empty.
public static IsNotEmpty ( this text ) : bool
text this
Результат bool

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

public static Join ( this items ) : string
items this
Результат string

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

public static Join ( this items, string separator ) : string
items this
separator string
Результат string

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

Join the items together
public static Join ( this items, string separator, string template ) : string
items this The items to join.
separator string The separator.
template string The template to format the items with.
Результат string

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

Left of the first occurance of c
public static LeftOf ( this text, char c ) : string
text this
c char
Результат string

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

Left of the n'th occurance of c
public static LeftOf ( this text, char c, int n ) : string
text this
c char
n int
Результат string

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

Left of the first occurance of text
public static LeftOf ( this text, string value ) : string
text this
value string
Результат string

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

public static LeftOfRightmostOf ( this text, char c ) : string
text this
c char
Результат string

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

public static LeftOfRightmostOf ( this text, string value ) : string
text this
value string
Результат string

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

Pad the left side of a string with characters to make the total length.
public static PadLeft ( this text, char c, Int32 totalLength ) : string
text this
c char
totalLength System.Int32
Результат string

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

Pad the right side of a string with a '0' if a single character.
public static PadRight ( this text ) : string
text this
Результат string

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

Pad the right side of a string with characters to make the total length.
public static PadRight ( this text, char c, Int32 totalLength ) : string
text this
c char
totalLength System.Int32
Результат string

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

public static Randomize ( this chars ) : string
chars this
Результат string

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

Generate a random string of character at a certain length
public static Randomize ( this chars, int length ) : string
chars this The Characters to use in the random string
length int The length of the random string
Результат string

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

public static ReplaceLastInstanceOf ( this text, string oldValue, string newValue ) : string
text this
oldValue string
newValue string
Результат string

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

Right of the first occurance of c
public static RightOf ( this text, char c ) : string
text this
c char
Результат string

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

Right of the n'th occurance of c
public static RightOf ( this text, char c, int n ) : string
text this
c char
n int
Результат string

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

Right of the first occurance of text
public static RightOf ( this text, string value ) : string
text this
value string
Результат string

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

Right of the n'th occurance of c
public static RightOf ( this text, string c, int n ) : string
text this
c string
n int
Результат string

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

public static RightOfRightmostOf ( this text, char c ) : string
text this
c char
Результат string

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

public static RightOfRightmostOf ( this text, string value ) : string
text this
value string
Результат string

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

public static Test ( this text, string pattern ) : bool
text this
pattern string
Результат bool

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

public static Test ( this text, string pattern, RegexOptions options ) : bool
text this
pattern string
options RegexOptions
Результат bool

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

public static ToCamelCase ( this text ) : string
text this
Результат string

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

public static ToCamelCase ( this values, string separator ) : string
values this
separator string
Результат string

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

Accepts a string like "ArrowRotateClockwise" and returns "arrow_rotate_clockwise.png".
public static ToCharacterSeparatedFileName ( this name, char separator, string extension ) : string
name this
separator char
extension string
Результат string

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

public static ToLowerCamelCase ( this text ) : string
text this
Результат string

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

MD5Hash's a string.
public static ToMD5Hash ( this text ) : string
text this
Результат string

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

Converts the first character of each word to Uppercase. Example: "the lazy dog" returns "The Lazy Dog"
public static ToTitleCase ( this text ) : string
text this The text to convert to sentence case
Результат string

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

Converts the first character of each word to Uppercase. Example: "the lazy dog" returns "The Lazy Dog"
public static ToTitleCase ( this text, CultureInfo ci ) : string
text this The text to convert to sentence case
ci System.Globalization.CultureInfo
Результат string

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

public static Wrap ( this text, string wrapByText ) : string
text this
wrapByText string
Результат string

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

public static Wrap ( this text, string wrapStart, string wrapEnd ) : string
text this
wrapStart string
wrapEnd string
Результат string