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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading from an array 1

Status
Not open for further replies.

o1568501

Programmer
Feb 8, 2005
14
GB
Hi,
I have constructed the following in C#:

string[] lv_RemoveList = new string[2]{"<P>","</P>"};
OR
string[] lv_RemoveList = new string[2]
lv_RemoveList[0] = "<P>";
lv_RemoveList[1] = "</P>";

when I do lv_RemoveList[1] it says it is empty.

Am I doing something wrong?
 
Either way is correct and is working for me. Can you post more of the functional code so we can check for something else? (How are you determinging it is empty?)
 
Was just doing: Response.Write(""+lv_RemoveList[1]); and it was returining nothing.
?????
 
Why is it when I just post a question I get the damn thing working! Its working now! Dont suppose u would know how I should I set the debugger up so that I can view variables/arrays etc in the Console window?
 
Hm, better post a larger code snippet. Here's what I did that worked:
Code:
string[] test = new string[2]{"test", "ing"};
MessageBox.Show(test[1]);
 
Glad you got it going. I usually just set a break point in the visual editor, that will get you back into where you need to examine things.
 
Thanks for the help :) (As I am sure you realise I am new to c#)
 
No problem, I am just migrating from C++ to C# myself and was in the middle of typing up a question when I answered yours, looked back and was able to fix mine, so I definitely understand the "solved it right after I posted the question" syndrome. ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top