TrimEnd for byte[]

Is there any way to trim certain whitespaces at the end of the byte[]?
ssdjgru1Asked:
Who is Participating?
 
prakash_prkCommented:
Try this .

byte[] by;
string sd=System.Text.Encoding.UTF8.GetString(by);
sd=sd.TrimEnd(" ");//Chars you want to trim
by=System.Text.Encoding.UTF8.GetBytes(sd);

Regrads
Prakash

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.