Matches result to array one step


#1

Hi,

I used matches and got this result in IEnumberable type. I know that I can use a for loop and string.join to capture all the results as one string. I can then split this one string into a string array. My question is is there a more efficient way to skip the string.join step and put the match result directly into a string array? Thanks!

Lavina


#2

@lavint

You try this , Iam not sure

Let us take your result as ABC which is of type IEnumerable

String[] EFG =  (From p in ABC
                         Select Convert.ToString(p)).ToArray

Regards
Mahesh