Trimming Unwanted Characters O the Start C# with Example



Trimming Unwanted Characters O the Start C# with Example

and/or End of Strings 
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" 

0 Comment's

Comment Form

Submit Comment