string.Format() csharp

Code Example - string.Format() csharp

                
                        int amount = 14;
String s = String.Format("這是今年吃的第{0}顆柚子",amount);
Console.WriteLine(s);
//這裡會輸出這是今年吃的第14顆柚子
                    
                
 

formatted string csharp

                        
                                string b = "world.";

Console.WriteLine("Hello {0}", b);
                            
                        
 

Related code examples