C# 클래스 NSupport.StringToNumberConversion

Provides extension methods for String for conversion and checking to other types.
파일 보기 프로젝트 열기: jittuu/NSupport

공개 메소드들

메소드 설명
AsDecimal ( this source ) : decimal?

Return converted Decimal if successfully parsed, otherwise null (Nothing in Visual Basic).

AsDecimal ( this source, NumberStyles style ) : decimal?

Return converted Decimal if successfully parsed, otherwise null (Nothing in Visual Basic).

AsDouble ( this source ) : double?

Return converted Double if successfully parsed, otherwise null (Nothing in Visual Basic).

AsDouble ( this source, NumberStyles style ) : double?

Return converted Double if successfully parsed, otherwise null (Nothing in Visual Basic).

AsInt32 ( this source ) : int?

Return converted Int32 if successfully parsed, otherwise null (Nothing in Visual Basic).

AsInt32 ( this source, NumberStyles style ) : int?

Return converted Int32 if successfully parsed, otherwise null (Nothing in Visual Basic).

AsInt64 ( this source ) : long?

Return converted Int64 if successfully parsed, otherwise null (Nothing in Visual Basic).

AsInt64 ( this source, NumberStyles style ) : long?

Return converted Int64 if successfully parsed, otherwise null (Nothing in Visual Basic).

IsNumber ( this source ) : bool

Return whether the provided String is number. It call overload method with this combination of NumberStyles (NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.AllowLeadingSign | NumberStyles.AllowTrailingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands;).

IsNumber ( this source, NumberStyles style ) : bool

Return whether the provided String is number with provided NumberStyles.

ToDecimal ( this source ) : decimal

Return converted Decimal.

ToDecimal ( this source, NumberStyles style ) : decimal

Return converted Decimal.

ToDouble ( this source ) : double

Return converted Double.

ToDouble ( this source, NumberStyles style ) : double

Return converted Double.

ToInt32 ( this source ) : int

Return converted Int32.

ToInt32 ( this source, NumberStyles style ) : int

Return converted Int32.

ToInt64 ( this source ) : long

Return converted Int64.

ToInt64 ( this source, NumberStyles style ) : long

Return converted Int64.

메소드 상세

AsDecimal() 공개 정적인 메소드

Return converted Decimal if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsDecimal ( this source ) : decimal?
source this A instance.
리턴 decimal?

AsDecimal() 공개 정적인 메소드

Return converted Decimal if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsDecimal ( this source, NumberStyles style ) : decimal?
source this A instance.
style NumberStyles A to parse against .
리턴 decimal?

AsDouble() 공개 정적인 메소드

Return converted Double if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsDouble ( this source ) : double?
source this A instance.
리턴 double?

AsDouble() 공개 정적인 메소드

Return converted Double if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsDouble ( this source, NumberStyles style ) : double?
source this A instance.
style NumberStyles A to parse against .
리턴 double?

AsInt32() 공개 정적인 메소드

Return converted Int32 if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsInt32 ( this source ) : int?
source this A instance.
리턴 int?

AsInt32() 공개 정적인 메소드

Return converted Int32 if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsInt32 ( this source, NumberStyles style ) : int?
source this A instance.
style NumberStyles A to parse against .
리턴 int?

AsInt64() 공개 정적인 메소드

Return converted Int64 if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsInt64 ( this source ) : long?
source this A instance.
리턴 long?

AsInt64() 공개 정적인 메소드

Return converted Int64 if successfully parsed, otherwise null (Nothing in Visual Basic).
public static AsInt64 ( this source, NumberStyles style ) : long?
source this A instance.
style NumberStyles A to parse against .
리턴 long?

IsNumber() 공개 정적인 메소드

Return whether the provided String is number. It call overload method with this combination of NumberStyles (NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite | NumberStyles.AllowLeadingSign | NumberStyles.AllowTrailingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands;).
public static IsNumber ( this source ) : bool
source this A instance.
리턴 bool

IsNumber() 공개 정적인 메소드

Return whether the provided String is number with provided NumberStyles.
public static IsNumber ( this source, NumberStyles style ) : bool
source this A instance.
style NumberStyles A to check against .
리턴 bool

ToDecimal() 공개 정적인 메소드

Return converted Decimal.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than .
public static ToDecimal ( this source ) : decimal
source this A instance.
리턴 decimal

ToDecimal() 공개 정적인 메소드

Return converted Decimal.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than . Throws when is not valid
public static ToDecimal ( this source, NumberStyles style ) : decimal
source this A instance.
style NumberStyles A to parse against .
리턴 decimal

ToDouble() 공개 정적인 메소드

Return converted Double.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than .
public static ToDouble ( this source ) : double
source this A instance.
리턴 double

ToDouble() 공개 정적인 메소드

Return converted Double.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than . Throws when is not valid
public static ToDouble ( this source, NumberStyles style ) : double
source this A instance.
style NumberStyles A to parse against .
리턴 double

ToInt32() 공개 정적인 메소드

Return converted Int32.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than .
public static ToInt32 ( this source ) : int
source this A instance.
리턴 int

ToInt32() 공개 정적인 메소드

Return converted Int32.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than . Throws when is not valid
public static ToInt32 ( this source, NumberStyles style ) : int
source this A instance.
style NumberStyles A to parse against .
리턴 int

ToInt64() 공개 정적인 메소드

Return converted Int64.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than .
public static ToInt64 ( this source ) : long
source this A instance.
리턴 long

ToInt64() 공개 정적인 메소드

Return converted Int64.
Throws when is null. Throws when is not correct format. Throws when represents a number less than or greater than . Throws when is not valid
public static ToInt64 ( this source, NumberStyles style ) : long
source this A instance.
style NumberStyles A to parse against .
리턴 long