TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jacob R
NA
38
0
Malfunction: byte 256 to string
Feb 8 2010 2:48 AM
I'm getting a byte array from a server on the return it is set up like..
byte
[] myBytes =
new
byte
[256];
Now when I try to convert it to a string with ASCIIEncoding it get the string and then I get the rest of the 256 characters as /0/0/0/0/0 ect... I've tried
string.Replace("
\\0
", ""); and it didn't take them away. I've also tried .Remove() but once It hits the .Indexof("
\\0
") I get an error like they aren't even there.
To encode I tried:
s =
new
string
(
Encoding
.ASCII.GetChars(myBytes));
s =
ASCIIEncoding
.ASCII.GetString(myBytes);
s =
Encoding
.ASCII.GetString(myBytes, 0, myBytes.Length);
and nothing seems to work to get rid of all of the /0/0/0's
help me plz
Reply
Answers (
1
)
Export to Excel
Leaving a textbox after deletng content with backspace