public static void Main()
var fullName = "Arturas Morozovas ";
Console.WriteLine("Using Trim - Trim: '{0}'",fullName.Trim());
Console.WriteLine("Not Using - Trim: '{0}'", fullName);
Console.WriteLine("Using ToUpper - To Upper: {0}",fullName.ToUpper());
Console.WriteLine("Using ToLower - To Lower: {0}", fullName.ToLower());
var index = fullName.IndexOf(' ');
var firstName = fullName.Substring(0, index);
var lastName = fullName.Substring(index +1);
Console.WriteLine("Using IndexOf & Substring - First name :" + firstName);
Console.WriteLine("Using IndexOf & Substring - Last Name :" + lastName);
string[] names = fullName.Split(' ');
Console.WriteLine("Using Split - First name: " + names[0]);
Console.WriteLine("Using Split - Last name: " + names[1]);
Console.WriteLine("Replace Arturas to Arturo : " + fullName.Replace("Arturas", "Arturo"));
Console.WriteLine("Replace A with a : " + fullName.Replace("A", "a"));
Console.WriteLine("Replace blank space with nothing : " + fullName.Replace(" ", ""));
if (String.IsNullOrEmpty(null) || String.IsNullOrEmpty("") || String.IsNullOrEmpty(" ".Trim()))
Console.WriteLine("IsNullOrEmpty : Invalid");
if (String.IsNullOrWhiteSpace(null) || String.IsNullOrWhiteSpace(" "))
Console.WriteLine("IsNullOrWhiteSpace: Invalid");
int age = Convert.ToInt32(str);
Console.WriteLine("String to Number :" + age);
string stringPrice = price.ToString();
Console.WriteLine("From number to string :" + stringPrice);
string formattedStringPrice = price.ToString("C");
string formattedRoundedStringPrice = price.ToString("C0");
Console.WriteLine("From number to converted string :" + formattedStringPrice);
Console.WriteLine("From number to converted rounded String :" + formattedRoundedStringPrice);
Console.WriteLine("Enter a string to be converted to char");
string namee = Console.ReadLine();
char[] nameCharArray = namee.ToCharArray();
foreach (var element in nameCharArray)
Console.WriteLine(element);