I an using ASP.Net with C# codebehind. I have the following code behind an aspx Page. The code runs successfully.
private void Button1_Click(object sender, System.EventArgs e)
a = "abcdefghijklmnopqrstuvwxyz";
b = a.Substring(2); //breakpoint on this line
My issue is that when I try to look at the value of a.Substring(2) in the IDE while debuging.
I have a breakpoint set at 'b = a.Substring(2)'. If i try ?a in the immediate window or put a watch on a i get "abcdefghijklmnopqrstuvwxyz" as expected. If i do the same with b I get null as expected. If I try ?a.Substring(2) in the immediate window or put a watch on a.Substring(2) I expect to receive "cdefghijklmnopqrstuvwxyz", however I get an error - "error: 'a.Substring' does not exist"
I have tried the same code in vb code behind and the IDE works as expected!
Why can I not check the value or variable.SubString() in the IDE for C# code?
I am looking for a definitive reason why?