C# Language Trimming Unwanted Characters Off the Start and/or End of Strings.

Download C# Language for free

Example

String.Trim()

string x = "   Hello World!    ";
string y = x.Trim(); // "Hello World!"

string q = "{(Hi!*";
string r = q.Trim( '(', '*', '{' ); // "Hi!"

String.TrimStart() and String.TrimEnd()

string q = "{(Hi*";
string r = q.TrimStart( '{' ); // "(Hi*"
string s = q.TrimEnd( '*' );   // "{(Hi" 
Conditional Statements