Format a string

   
  

using System;
using System.Collections.Generic;
using System.Text;

class Program {
    static void Main(string[] args) {
        int theInt = 90;
        double theDouble = 9.99;
        bool theBool = true;

        Console.WriteLine("Int is: {0}
Double is: {1}
Bool is: {2}",theInt, theDouble, theBool);
    }
}

   
     


Sample for String.Compare(String, Int32, String, Int32, Int32, Boolean), Honor case

   
  
using System;

class Sample {
    public static void Main() {
        String str1 = "this is a test";
        String str2 = "This is a test";
        String str;
        int result;
    
        Console.WriteLine("Honor case:");
        result = String.Compare(str1, 2, str2, 2, 2, false);
        str = ((result < 0) ? "less than" : ((result > 0) ? "greater than" : "equal to"));
        Console.Write("Substring &#039;{0}&#039; in &#039;{1}&#039; is ", str1.Substring(2, 2), str1);
        Console.Write("{0} ", str);
        Console.WriteLine("substring &#039;{0}&#039; in &#039;{1}&#039;.", str2.Substring(2, 2), str2);
    
    }
}