using System;
class MainClass {
public static void Main() {
string[] myStrings = {"To", "be", "or", "not","to", "be"};
string myString = String.Join(".", myStrings);
Console.WriteLine("myString = " + myString);
if (myString.StartsWith("To")) {
Console.WriteLine("myString starts with \"To\"");
}
if (myString.EndsWith("be")) {
Console.WriteLine("myString ends with \"be\"");
}
}
}
|