pkrish
asked on
trying to expand range of characters specified in a list object
Hi all,
I have a method called "get_range_alphabets(List lp)"
I am passing a List object lp of type ('t,x-z,a')
I want to get the output as ('a','t','x','y',z').
The output list is in order and it expands on the range x-z.
Can someone suggest a solution?
Thanks for your help,
pkrish
I have a method called "get_range_alphabets(List lp)"
I am passing a List object lp of type ('t,x-z,a')
I want to get the output as ('a','t','x','y',z').
The output list is in order and it expands on the range x-z.
Can someone suggest a solution?
Thanks for your help,
pkrish
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How is your range specified, i.e. how do you know it's not just individual characters?
ASKER
CEHJ,
range is specified as one of the elements in the list "a-d" and that needs to be extracted and expanded along with the individual characters.
Arun kuttz's solution works fine for me.
Thanks kuttz and all.
then use a loop to loop thru the chars
for (char c=startc; c<=endc;c++)
{
// add c to result list