0

Im from a c++ backround so I am not sure exactly how to do what Im trying to accomplish.

If myString1 = "hello"
and myString2 = "hello\0\0\0\0\0\0\0"

Im looking to trim off all of the null charecters.

Thanks.

Edit: So i was just trying to use the Remove method. I did:

int count = myString1.Length;
myString2.Remove(count);

But to no avail.

One more Edit: I didnt relize the Remove method returns a string. I got it working.

Edited by LevyDee: n/a

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by ashishkumar008
0

string str=" levydeewithspace ";
string newstr=str.Trim();

//This code remove all blank space present on both side of string.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.