Home All Groups Group Topic Archive Search About

Re: stringbuilder - .tostring not returning all data?

Author
23 Mar 2006 6:23 PM
Tom Shelton
Mad Scientist Jr wrote:
Show quoteHide quote
> I seem to have more data in my stringbuilder than .ToString is
> returning.
>
> Any idea why? Is there a limitation? Workaround?
>
> Thanks
>
> ?Stringbuilder1.Length
> 145264
> ?Stringbuilder1.ToString.Length
> 153
> ?Stringbuilder1.MaxCapacity
> 2147483647
> ?Stringbuilder1.Capacity
> 274432

What is contained in the StringBuilder?  You don't have binary data
(like null characters) embeded in there do you?  It might be helpful to
show the source of the data in the StringBuilder...

--
Tom Shelton [MVP]

Author
30 Mar 2006 11:37 PM
Mad Scientist Jr
Not binary data per se, I *am* reading a binary file, byte by byte, and
if the byte is within the range of ASCII (32 - 127) it appeands the CHR
of it to the stringbuilder.

Tom Shelton wrote:
Show quoteHide quote
> Mad Scientist Jr wrote:
> > I seem to have more data in my stringbuilder than .ToString is
> > returning.
> >
> > Any idea why? Is there a limitation? Workaround?
> >
> > Thanks
> >
> > ?Stringbuilder1.Length
> > 145264
> > ?Stringbuilder1.ToString.Length
> > 153
> > ?Stringbuilder1.MaxCapacity
> > 2147483647
> > ?Stringbuilder1.Capacity
> > 274432
>
> What is contained in the StringBuilder?  You don't have binary data
> (like null characters) embeded in there do you?  It might be helpful to
> show the source of the data in the StringBuilder...
>
> --
> Tom Shelton [MVP]