C# 클래스 PRI.ProductivityExtensions.StringExtensions.Stringable

Class that contains extension methods that extend String
파일 보기 프로젝트 열기: peteraritchie/ProductivityExtensions

공개 메소드들

메소드 설명
CopyTo ( this text, Int32 sourceIndex, Char destination ) : void

Extends CopyTo so that buffer offset of 0 and call to Array.Length are not needed. text.CopyTo(sourceIndex, destination);

FirstWord ( this value ) : string

Get the first "Word" in a string--separated by space.

Initials ( this value ) : string
IsEmpty ( this value ) : bool
Left ( this s, int length ) : string

Returns the first few characters of the string with a length specified by the given parameter. If the string's length is less than the given length the complete string is returned. If length is zero or less an empty string is returned

ReplaceEach ( this text, IEnumerable chars, char c ) : string

Replace any instances of individual elements in chars with c in text.

Right ( this s, int length ) : string

Returns the last few characters of the string with a length specified by the given parameter. If the string's length is less than the given length the complete string is returned. If length is zero or less an empty string is returned

ToBoolOrNull ( this source ) : bool?

conert a string to a boolean. Ignore-compare of "True" for true, and "False" for false.

ToDateTimeOrNull ( this source ) : DateTime?

Convert a string value to a DateTime.

ToDecimalOrDefault ( this source ) : decimal

Convert a string value to decimal.

ToDecimalOrNull ( this source ) : decimal?

Convert a string value to decimal.

ToDoubleOrDefault ( this source ) : double

Convert a string value to double.

ToDoubleOrNull ( this source ) : double?

Convert a string value to double.

ToGuidOrNull ( this source ) : Guid?

Convert a string to a GUID

ToInt ( this source, int defaultValue ) : int

Convert a string value to an int.

ToIntOrDefault ( this source ) : int

Convert a string value to an int.

ToIntOrNull ( this source ) : int?

Convert a string value to an int.

ToLongOrDefault ( this source ) : long

Convert a string value to a long.

ToLongOrNull ( this source ) : long?

Convert a string value to a long.

ToTimeSpanOrNull ( this source ) : TimeSpan?

Convert a string value to a TimeSpan.

Truncate ( this text, int maxLength ) : string

Truncate string text to a maximim length of maxLength

메소드 상세

CopyTo() 공개 정적인 메소드

Extends CopyTo so that buffer offset of 0 and call to Array.Length are not needed. text.CopyTo(sourceIndex, destination);
public static CopyTo ( this text, Int32 sourceIndex, Char destination ) : void
text this
sourceIndex System.Int32
destination Char
리턴 void

FirstWord() 공개 정적인 메소드

Get the first "Word" in a string--separated by space.
public static FirstWord ( this value ) : string
value this
리턴 string

Initials() 공개 정적인 메소드

public static Initials ( this value ) : string
value this
리턴 string

IsEmpty() 공개 정적인 메소드

public static IsEmpty ( this value ) : bool
value this
리턴 bool

Left() 공개 정적인 메소드

Returns the first few characters of the string with a length specified by the given parameter. If the string's length is less than the given length the complete string is returned. If length is zero or less an empty string is returned
public static Left ( this s, int length ) : string
s this the string to process
length int Number of characters to return
리턴 string

ReplaceEach() 공개 정적인 메소드

Replace any instances of individual elements in chars with c in text.
public static ReplaceEach ( this text, IEnumerable chars, char c ) : string
text this string to search within.
chars IEnumerable individual characters to search for.
c char character to replace any found characters with.
리턴 string

Right() 공개 정적인 메소드

Returns the last few characters of the string with a length specified by the given parameter. If the string's length is less than the given length the complete string is returned. If length is zero or less an empty string is returned
public static Right ( this s, int length ) : string
s this the string to process
length int Number of characters to return
리턴 string

ToBoolOrNull() 공개 정적인 메소드

conert a string to a boolean. Ignore-compare of "True" for true, and "False" for false.
public static ToBoolOrNull ( this source ) : bool?
source this
리턴 bool?

ToDateTimeOrNull() 공개 정적인 메소드

Convert a string value to a DateTime.
public static ToDateTimeOrNull ( this source ) : DateTime?
source this
리턴 DateTime?

ToDecimalOrDefault() 공개 정적인 메소드

Convert a string value to decimal.
public static ToDecimalOrDefault ( this source ) : decimal
source this
리턴 decimal

ToDecimalOrNull() 공개 정적인 메소드

Convert a string value to decimal.
public static ToDecimalOrNull ( this source ) : decimal?
source this
리턴 decimal?

ToDoubleOrDefault() 공개 정적인 메소드

Convert a string value to double.
public static ToDoubleOrDefault ( this source ) : double
source this
리턴 double

ToDoubleOrNull() 공개 정적인 메소드

Convert a string value to double.
public static ToDoubleOrNull ( this source ) : double?
source this
리턴 double?

ToGuidOrNull() 공개 정적인 메소드

Convert a string to a GUID
public static ToGuidOrNull ( this source ) : Guid?
source this
리턴 Guid?

ToInt() 공개 정적인 메소드

Convert a string value to an int.
public static ToInt ( this source, int defaultValue ) : int
source this
defaultValue int
리턴 int

ToIntOrDefault() 공개 정적인 메소드

Convert a string value to an int.
public static ToIntOrDefault ( this source ) : int
source this
리턴 int

ToIntOrNull() 공개 정적인 메소드

Convert a string value to an int.
public static ToIntOrNull ( this source ) : int?
source this
리턴 int?

ToLongOrDefault() 공개 정적인 메소드

Convert a string value to a long.
public static ToLongOrDefault ( this source ) : long
source this
리턴 long

ToLongOrNull() 공개 정적인 메소드

Convert a string value to a long.
public static ToLongOrNull ( this source ) : long?
source this
리턴 long?

ToTimeSpanOrNull() 공개 정적인 메소드

Convert a string value to a TimeSpan.
public static ToTimeSpanOrNull ( this source ) : TimeSpan?
source this
리턴 TimeSpan?

Truncate() 공개 정적인 메소드

Truncate string text to a maximim length of maxLength
public static Truncate ( this text, int maxLength ) : string
text this
maxLength int
리턴 string