Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text truncating 1

Status
Not open for further replies.

dragonwell

Programmer
Oct 21, 2002
863
US
I am creating a string from an array of characters using

Code:
New String(myArray)

When I add that variable (the new string) to a longer string and feed it to a TextWriter, the text gets truncated after the location of my variable.

The strange thing is, when I view it in the debugger the string is displayed (in red after I create it) like this
Code:
"myString

Note the missing quote? I figure that's what's causing it to truncate. What's going on?


Greetings,
Dragonwell
 
You left out all the context code didn't you?

How do you create the string from an array of characters?

How do you add that variable (the new string) to a longer string and feed it to a TextWriter?
 
More than likely the string you created from an array of characters is null-padded (has 0x00 bytes out to the length of the original array).

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top