string myString = ""; if(StringUtil.IsNullOrEmpty(myString)){ Console.WriteLine("The string is empty or null"); }
string myString = " Hello World "; myString = StringUtil.Trim(myString); // removes white spaces myString = StringUtil.AppendSuffix(myString, "!"); // adds suffix Console.WriteLine(myString); // output: "Hello World!"
string myString = "this is a sample string"; myString = StringUtil.ToTitleCase(myString); Console.WriteLine(myString); // output: "This Is A Sample String"In summary, StringUtil is a built-in class in the .NET Framework that provides convenient methods for manipulating strings in C#. It is part of the System namespace and can be used without any additional package or library.