G
Garfield
Hello
I have a function that returns a string array. The string has a name and an ID number, they are separated by a comma.
I cannot for the life of me by using the string methods get to separate the two items.
Example.
The string array looks like, the array is called Trainee :-
Joe Bloggs,5678
Henry Kissinger,2345
I want to separate the two using the ',' as the separator because I'm building a drop-down list
I have tried to get the name part by doing
ListItem.Text = Trainee[0].substring(0,trainee[0].Length - Trainee[0].IndexOf(',') - 1);
ListItem.Value=Trainee[0].substring(Trainee[0].IndexOf(',') + 1,4);
This doesn't compile, the string methods are not being recognised and I can't see how to do it. I mean I could change my function to send back two variables, but I would prefer to use the language to get my results.
Thanks for any help.
Regards
Garfield
I have a function that returns a string array. The string has a name and an ID number, they are separated by a comma.
I cannot for the life of me by using the string methods get to separate the two items.
Example.
The string array looks like, the array is called Trainee :-
Joe Bloggs,5678
Henry Kissinger,2345
I want to separate the two using the ',' as the separator because I'm building a drop-down list
I have tried to get the name part by doing
ListItem.Text = Trainee[0].substring(0,trainee[0].Length - Trainee[0].IndexOf(',') - 1);
ListItem.Value=Trainee[0].substring(Trainee[0].IndexOf(',') + 1,4);
This doesn't compile, the string methods are not being recognised and I can't see how to do it. I mean I could change my function to send back two variables, but I would prefer to use the language to get my results.
Thanks for any help.
Regards
Garfield