C# UInt64 Parse(String, IFormatProvider)
Description
UInt64 Parse(String, IFormatProvider)
converts the
string representation of a number in a specified culture-specific format
to its 64-bit unsigned integer equivalent.
Syntax
UInt64.Parse(String, IFormatProvider)
has the following syntax.
[CLSCompliantAttribute(false)]/*from w w w .ja va 2 s. c o m*/
public static ulong Parse(
string s,
IFormatProvider provider
)
Parameters
UInt64.Parse(String, IFormatProvider)
has the following parameters.
s
- A string that represents the number to convert.provider
- An object that supplies culture-specific formatting information about s.
Returns
UInt64.Parse(String, IFormatProvider)
method returns A 64-bit unsigned integer equivalent to the number specified in s.
Example
The following example shows how to use UInt64.Parse(String, IFormatProvider).
// w ww . ja v a 2s.c o m
using System.Globalization;
using System;
public class MainClass{
public static void Main(String[] argv){
string locale;
float number;
CultureInfo culture = new CultureInfo("en-US");
try
{
number = Single.Parse("123", culture.NumberFormat);
}
catch (FormatException)
{
return;
}
catch (Exception)
{
return;
}
}
}
The code above generates the following result.