Internationalization and localization tools


C# Type Conversion

In C#, everything is regarded as an object. As a consequence, the primitive types can be used where objects are expected without any type conversion, and it is possible to call object methods on them directly. For example the following code will compile in C#:

int n = 3 // declare an integer

string s = n.ToString(); // convert to a string for display

This is in contrast to Java, where the basic types have no object-like behavior and need to be explicitly converted to and from object wrappers.

Of course, the output from the code above is not likely to be rendered in a culturally correct way. Here is where the NumberFormatInfo class comes into play; it acts as a formatter in the overloaded ToString method to provide a multiplicity of outputs.

Click on a function for more information:

Parse()

FromString()

ToChar()

ToString()

TypeConverter.ConvertTo ()

TypeConverter.ConvertFrom()

TypeConverter.ConvertFromString ()

TypeConverter.ConvertToString ()

 

 Locale-Sensitive C# Methods

 

Lingoport internationalization and localization services and software