boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

Trimming and Removing Characters from Strings in C#

Updated on     Kisan Patel

If you have a string with a specific set of characters like delimiters, spaces, or some other characters at the beginning and/or end of the string and you want to trim the string then you need to use Trim instance method:

string foo = " FIRST NAME ";
Console.WriteLine(foo.Trim()); // it remove spaces and displays "FIRST NAME"

If you want to trim the specific characters at the beginning and/or end of the string:

string foo = "--FIRST NAME--";
Console.WriteLine(foo.Trim(new char[] {'-', ' '})); 
//it remove spaces and displays "FIRST NAME"

Console.WriteLine(foo.TrimStart(new char[] {'-', ' '})); 
//remove from beginning and displays "FIRST NAME--"

Console.WriteLine(foo.TrimEnd(new char[] {'-', ' '})); 
//remove at end and displays "--FIRST NAME"

C#

Leave a Reply