473,320 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Incorrect String Debug/Watch Info

It's possible to print out a string's Length property in my code like so:

string asdf = "asdf\0asdf";
Console.WriteLine(asdf); // = "asdf asdf"
Console.WriteLine(asdf.Length); // = 9

However if you try to use the VS.NET debugger's Watch to inspect this,
you'll see that asdf is displayed as "asdf" and asdf.Length is displayed as
4, not 9.

Now I can understand (though not approve of) the IDE's inability to display
the former correctly. However, why doesn't the IDE read from the actual
Length property of the asdf String object (and instead re-calculate the
length on its own)?

And will any of these problems be fixed?
Jul 19 '05 #1
3 1711
OvErboRed <ov*********@SPAMoverbored.net> wrote:
It's possible to print out a string's Length property in my code like so:

string asdf = "asdf\0asdf";
Console.WriteLine(asdf); // = "asdf asdf"
Console.WriteLine(asdf.Length); // = 9

However if you try to use the VS.NET debugger's Watch to inspect this,
you'll see that asdf is displayed as "asdf" and asdf.Length is displayed as
4, not 9.

Now I can understand (though not approve of) the IDE's inability to display
the former correctly. However, why doesn't the IDE read from the actual
Length property of the asdf String object (and instead re-calculate the
length on its own)?

And will any of these problems be fixed?


I thought these problems were fixed in VS.NET 2003 - which version are
you using?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Jul 19 '05 #2
I'm using the original VS.NET. Is there an (official) comprehensive list of
bugs found/fixed anywhere?

Jon Skeet <sk***@pobox.com> wrote in
news:MP************************@news.microsoft.com :
I thought these problems were fixed in VS.NET 2003 - which version are
you using?


Jul 19 '05 #3
OvErboRed <ov*********@SPAMoverbored.net> wrote:
I'm using the original VS.NET. Is there an (official) comprehensive list of
bugs found/fixed anywhere?


Not that I've seen, I'm afraid - although that doesn't mean there isn't
one somewhere.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Senthoorkumaran Punniamoorthy | last post by:
I am printing these information. print string.lower(info_res) print string.lower(md5sum(f_md5)) print len(string.lower(info_res)) print len(string.lower(md5sum(f_md5))) print...
8
by: Davy | last post by:
Hi all, I use VC and gcc/gdb to compile and debug C/C++ files. But I found some of the debug version of the compiled files are too large to be run in a small RAM. Can I compile C/C++ Debug...
3
by: OvErboRed | last post by:
It's possible to print out a string's Length property in my code like so: string asdf = "asdf\0asdf"; Console.WriteLine(asdf); // = "asdf asdf" Console.WriteLine(asdf.Length); // = 9 However...
19
by: David zhu | last post by:
I've got different result when comparing two strings using "==" and string.Compare(). The two strings seems to have same value "1202002" in the quick watch, and both have the same length 7 which I...
6
by: Greg Merideth | last post by:
While I can't post all of the code I'll post snippets but, it appears that C# is *not* assigning a string, inside of a class, a value that I am passing to it using its public set method and I can't...
7
by: Brad | last post by:
When debugging my current web project, in VS2003, I found I had lost the ability to drill down on watch objects in the Watch Window; I could only view the single value specific watch objects. ...
3
by: murphy | last post by:
Hi, I've been seeing two symptoms with my asp.net site that have started recently after a long period of smooth running. As others on our team make changes to referenced dll's I find that I...
4
by: Laurel | last post by:
Is there a way, in the debugger, to look at the contents of a dataset? I tried drilling down into my dataset and it's like exploring the registry! Anyway, I didn't find anything useful. The code...
15
geolemon
by: geolemon | last post by:
I'm having a seriously Twilight Zone moment: In the code below, I'm building a SQL command into a string variable, declared at the top of my code. Then, I connect to the database and try to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.