Strings2

Console.WriteLine("Give me a string..."); string str; str = Console.ReadLine(); // display the variable Console.WriteLine("The string is: " + str); // capitalize it, and display it str = str.ToUpper(); Console.WriteLine("Capitalized: " + str); // convert it to lower case, and display it str = str.ToLower(); Console.WriteLine("Lower Case: " + str); // trim any empty spaces, and display it str = str.Replace(" ", ""); Console.WriteLine("No spaces: " +str);

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.