C# 클래스 SpeakFriend.Utilities.StringExtension

파일 보기 프로젝트 열기: teamaton/speak-lib

공개 메소드들

메소드 설명
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