create some strings
using System;
class MainClass {
public static void Main() {
string myString = "To be or not to be";
string myString2 = "...\t that is the question";
string myString3 = @"\t Friends, Romans, countrymen,
lend me your ears";
// display the strings and their Length properties
Console.WriteLine("myString = " + myString);
Console.WriteLine("myString.Length = "
+ myString.Length);
Console.WriteLine("myString2 = " + myString2);
Console.WriteLine
("myString2.Length = " + myString2.Length);
Console.WriteLine("myString3 = " + myString3);
Console.WriteLine
("myString3.Length = " + myString3.Length);
}
}
Related examples in the same category