Bridge

Decimal..::..TryParse Method (String, Decimal%)

Converts the string representation of a number to its Decimal equivalent. A return value indicates whether the conversion succeeded or failed.

Namespace:  System
Assembly:  Bridge (in Bridge.dll)

Syntax


[TemplateAttribute]
public static bool TryParse(
	string s,
	out decimal result
)
<TemplateAttribute> _
Public Shared Function TryParse ( _
	s As String, _
	<OutAttribute> ByRef result As Decimal _
) As Boolean
[TemplateAttribute]
public:
static bool^ TryParse(
	String^ s, 
	[OutAttribute] Decimal^% result
)

Parameters

s
Type: System..::..String
The string representation of the number to convert.
result
Type: System..::..Decimal%
When this method returns, contains the Decimal number that is equivalent to the numeric value contained in s, if the conversion succeeded, or is zero if the conversion failed. The conversion fails if the s parameter is null or Empty, is not a number in a valid format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.

Return Value

true if s was converted successfully; otherwise, false.