String.Compare(String value1, String value2, boolean case) : String « System « C# / C Sharp by API






String.Compare(String value1, String value2, boolean case)

   
using System;

class MainClass
{

  public static void Main()
  {
    
    int result;
    result = String.Compare("bbc", "abc");
    Console.WriteLine("String.Compare(\"bbc\", \"abc\") = " + result);
    result = String.Compare("abc", "bbc");
    Console.WriteLine("String.Compare(\"abc\", \"bbc\") = " + result);
    result = String.Compare("bbc", "bbc");
    Console.WriteLine("String.Compare(\"bbc\", \"bbc\") = " + result);
    result = String.Compare("bbc", "BBC", true);
    Console.WriteLine("String.Compare(\"bbc\", \"BBC\", true) = " + result);
    result = String.Compare("bbc", "BBC", false);
    Console.WriteLine("String.Compare(\"bbc\", \"BBC\", false) = " + result);
    result = String.Compare("Hello World", 6, "Goodbye World", 8, 5);
    Console.WriteLine("String.Compare(\"Hello World\", 6, " + "\"Goodbye World\", 8, 5) = " + result);

  }

}

   
    
    
  








Related examples in the same category

1.new String(char[] charArray)
2.String == String
3.String.Compare(String value1, String value2)
4.String.Concat(String value1, String value2)
5.String.Contains
6.String.Copy(String value)
7.String.Empty
8.String.EndsWith()
9.String.Equals(String aString)
10.String.Format(String format, Float aFloat);
11.String.IndexOf
12.String.IndexOfAny(char[] myChars)
13.String.Insert(int index, String value)
14.String.Join(String join, String value)
15.String.LastIndexOf
16.String.LastIndexOfAny(char[] myChars)
17.String.Length
18.String.PadLeft(int len)
19.String.PadLeft(int len, char ch)
20.String.PadRight(int len)
21.String.PadRight(int len, char ch)
22.String.Remove(int start, int end)
23.String.Replace(char ch, char ch2)
24.String.Replace(String value1, String value2)
25.String.Split(String splittor)
26.String.StartsWith()
27.String.SubString(int pos)
28.String.SubString(int start,)
29.String.ToCharArray
30.String.ToCharArray(int start,)
31.String.ToLower()
32.String.ToUpper()
33.String.Trim()
34.String.TrimEnd()
35.String.TrimStart()