Microsoft Interview Question

read the given string and print out how many same characters in the string

Interview Answer

Anonymous

Jan 26, 2019

// Use the Length property using System; class Sample { public static void Main() { string str = "abcdefg"; int length = str.Length; Console.WriteLine("The length of '{0}' is {1}", str, length); } } // This example displays the following output: // The length of 'abcdefg' is 7