PART II
C h a p t e r 2 1 :
E x p l o r i n g t h e S y s t e m N a m e s p a c e
629
public static double
Parse(string
str
,
IFormatProvider
fmtpvdr
)
Returns the binar y equivalent of the numeric
string in
str
using the culture-specific information
provided by
fmtpvdr.
If the string does not
represent a
double
value, an exception is thrown.
public static double
Parse(string
str
, NumberStyles
styles
)
Returns the binar y equivalent of the numeric
string in
str
using the style information provided
by
styles.
If the string does not represent a
double
value, an exception is thrown.
public static double
Parse(string
str
,
NumberStyles
styles
,
IFormatProvider
fmtpvdr
)
Returns the binary equivalent of the numeric
string in
str
using the style information provided by
styles
and the culture-specific format information
provided by
fmtpvdr.
If the string does not
represent a
double
value, an exception is thrown.
public override string ToString( )
Returns the string representation of the value of
the invoking object in the default format.
public string ToString(string
format
)
Returns the string representation of the value
of the invoking object as specified by the format
string passed in
format.
public string
ToString(IFormatProvider
fmtpvdr
)
Returns the string representation of the value
of the invoking object using the culture-specific
information specified in
fmtpvdr.
public string
ToString(string
format
,
IFormatProvider
fmtpvdr
)
Returns the string representation of the value
of the invoking object using the culture-specific
information specified in
fmtpvdr
and the format
specified by
format.
public static bool Tr yParse(string
str
,
out double
val
)
Attempts to conver t the numeric string in
str
into
a
double
value. If successful, the value is stored
in
val
and true is returned. If no conversion
takes place, false is returned. This differs from
Parse( )
, which throws an exception on failure.
public static bool Tr yParse(string
str
,
NumberStyles
styles,
IFormatProvider
fmtpvdr,
out double
val
)
Attempts to conver t the numeric string in
str
into a
double
value using the style information
provided by
styles
and the culture-specific format
information provided by
fmtpvdr.
If successful,
the value is stored in
val
and true is returned.
If no conversion takes place, false is returned.
This differs from
Parse( )
, which throws an
exception on failure.
Method
Meaning
T
ABLE
21-5
Methods Suppor ted by
Double
(continued)
www.freepdf-books.com
630
P a r t I I :
E x p l o r i n g t h e C # L i b r a r y
Do'stlaringiz bilan baham: |