VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/c-sharp-int32-tostring-method-set-1/

⇱ C# | Int32.ToString Method | Set - 1 - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C# | Int32.ToString Method | Set - 1

Last Updated : 11 Jul, 2025

Int32.ToString Method is used to converts the numeric value of the current Int32 instance to its equivalent string representation. There are 4 methods in the overload list of this method as follows:
Here, we will discuss the first two methods.
 

ToString(IFormatProvider) Method


This method is used to convert the numeric value of the current instance to its equivalent string representation using the specified culture-specific format information.
 

Syntax:  

public string ToString (IFormatProvider provider);


Parameters: This method takes an object of type IFormatProvider which supplies culture-specific formatting information.
Return Value: This method returns the string representation of the value of the current instance in the format specified by the provider parameter.
Example:


Output: 
The Value is 15 and provider is en-US

 

Int32.ToString(String, IFormatProvider) Method

This method is used to convert the numeric value of this instance to its equivalent string representation using the specified format and culture-specific formatting information.
 

Syntax:  

public string ToString (string format, IFormatProvider provider);


Parameters:  

format: It is a standard or custom numeric format string. 
provider: It is an object which supplies culture-specific formatting information. 
 


Return Value: This method returns the string representation of the current instance specified by the format and provider parameter.
Example:


Output: 
The value is 2147483647
The Format is D5
The Provider is fr-FR

 

Reference: 

Comment
Article Tags:

Explore