C# Класс SpeakFriend.Utilities.StringExtension

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

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

Метод Описание
EnsureEndsNotWith ( this value, string suffix ) : string

Returns a new string which is guaranteed not to end with the given suffix. If the suffix is already missing, the same string is returned.

EnsureEndsNotWith ( this value, string suffix, bool ignoreCase ) : string
EnsureEndsWith ( this value, string suffix ) : string

Returns a new string which is guaranteed to end with the given suffix. If the suffix is already present, the same string is returned.

EnsureEndsWith ( this value, string suffix, StringEnsureOptions options ) : string
EnsureStartsNotWith ( this value, string prefix ) : string

Returns a new string which is guaranteed not to begin with the given prefix. If the prefix is already missing, the same string is returned.

EnsureStartsWith ( this value, string prefix ) : string

Returns a new string which is guaranteed to begin with the given prefix. If the prefix is already present, the same string is returned.

EnsureStartsWith ( this value, string prefix, StringEnsureOptions options ) : string
Indent ( this value, int width ) : string
IsEmail ( this text ) : bool
IsNumeric ( this value ) : bool
IsUri ( this uri ) : bool
JoinNonEmpty ( this values, string separator ) : string
ToDate ( this dateText ) : DateTime?
ToInt ( this value ) : int
ToInt32 ( this value ) : int
Truncate ( this text, int maxLength ) : string

Truncates the string to a specified length and replace the truncated to a ...

Truncate ( this text, int maxLength, string suffix ) : string

Truncates the string to a specified length and replaces the truncated to a ...

WordWrap ( this text, int maxLineLength ) : List

Return a list of wrapped lines

Wrap ( this text, int maxLineLength ) : string

Returns the given text with lines separated by Environment.NewLine and a maximum length of maxLineLength. Uses WordWrap internally.

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

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

Returns a new string which is guaranteed not to end with the given suffix. If the suffix is already missing, the same string is returned.
public static EnsureEndsNotWith ( this value, string suffix ) : string
value this
suffix string
Результат string

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

public static EnsureEndsNotWith ( this value, string suffix, bool ignoreCase ) : string
value this
suffix string
ignoreCase bool
Результат string

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

Returns a new string which is guaranteed to end with the given suffix. If the suffix is already present, the same string is returned.
public static EnsureEndsWith ( this value, string suffix ) : string
value this
suffix string
Результат string

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

public static EnsureEndsWith ( this value, string suffix, StringEnsureOptions options ) : string
value this
suffix string
options StringEnsureOptions
Результат string

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

Returns a new string which is guaranteed not to begin with the given prefix. If the prefix is already missing, the same string is returned.
public static EnsureStartsNotWith ( this value, string prefix ) : string
value this
prefix string
Результат string

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

Returns a new string which is guaranteed to begin with the given prefix. If the prefix is already present, the same string is returned.
public static EnsureStartsWith ( this value, string prefix ) : string
value this
prefix string
Результат string

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

public static EnsureStartsWith ( this value, string prefix, StringEnsureOptions options ) : string
value this
prefix string
options StringEnsureOptions
Результат string

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

public static Indent ( this value, int width ) : string
value this
width int
Результат string

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

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

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

public static IsNumeric ( this value ) : bool
value this
Результат bool

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

public static IsUri ( this uri ) : bool
uri this
Результат bool

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

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

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

public static ToDate ( this dateText ) : DateTime?
dateText this
Результат DateTime?

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

public static ToInt ( this value ) : int
value this
Результат int

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

public static ToInt32 ( this value ) : int
value this
Результат int

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

Truncates the string to a specified length and replace the truncated to a ...
public static Truncate ( this text, int maxLength ) : string
text this string that will be truncated
maxLength int total length of characters to maintain before the truncate happens
Результат string

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

Truncates the string to a specified length and replaces the truncated to a ...
public static Truncate ( this text, int maxLength, string suffix ) : string
text this string that will be truncated
maxLength int total length of characters to maintain before the truncate happens
suffix string
Результат string

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

Return a list of wrapped lines
public static WordWrap ( this text, int maxLineLength ) : List
text this
maxLineLength int
Результат List

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

Returns the given text with lines separated by Environment.NewLine and a maximum length of maxLineLength. Uses WordWrap internally.
public static Wrap ( this text, int maxLineLength ) : string
text this
maxLineLength int
Результат string