use the Format() method to format a string : String Format : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » String Format »

 

use the Format() method to format a string








    
 

using System;

class MainClass {

    public static void Main() {
        
        float myFloat = 1234.56789f;
        string myString8 = String.Format("{0, 10:f3}", myFloat);
        Console.WriteLine("String.Format(\"{0, 10:f3}\", myFloat) = " + myString8);
    
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» String Format