R
ryanm
I'm having a problem here, and it probably means I need to find a good
book on C#, but maybe someone can point it out quickly. I want to populate a
string array with a bunch of strings. So I'm doing this:
class foo{
public String[] StringList;
public foo(){
SetStrings();
}
private void SetStrings(){
StringList[0] = "Literal String 1";
}
}
Now, eventually I will be getting the strings from a remote machine
rather than just sticking a literal in there, but it's stopping me at this.
How do I put a string literal into a string array? There is no constructor
for a string[] type, so I'm not sure how I'm supposed to instantiate the
object, or how I can push values into it. Any help or pointers to docs would
be appreciated. The VS.NET docs are more confusing than helpful because of
all the VB, C++, JScript, etc docs that go with it, so searches take an hour
to sort through all the stuff that's for a different language.
thanks,
ryanm
book on C#, but maybe someone can point it out quickly. I want to populate a
string array with a bunch of strings. So I'm doing this:
class foo{
public String[] StringList;
public foo(){
SetStrings();
}
private void SetStrings(){
StringList[0] = "Literal String 1";
}
}
Now, eventually I will be getting the strings from a remote machine
rather than just sticking a literal in there, but it's stopping me at this.
How do I put a string literal into a string array? There is no constructor
for a string[] type, so I'm not sure how I'm supposed to instantiate the
object, or how I can push values into it. Any help or pointers to docs would
be appreciated. The VS.NET docs are more confusing than helpful because of
all the VB, C++, JScript, etc docs that go with it, so searches take an hour
to sort through all the stuff that's for a different language.
thanks,
ryanm