this filters the list based on the first character in the string. It works perfectly if the value passed as alphaFilter matches the first character of a the m.title.
My problem is that i want an alpha character to filter on the same character, but i want to be able to pass a "#" character and retrieve all entries that start with a numeric value.
in other words, i want my select list of alphaFilter characters to look like this...
# A B C D
not
1 2 3 4 5 6 7 8 9 0 A B C D
I know there is probably an easy solution, but i'm having trouble finding it. Any help would be much appreciated
What is alphaFilter and how you are populating it. It seems to be string. If so, the posted code won't work if it has more than one characters i.e. alphaFilter = "A" would work but alphaFilter = "AB" won't. Have you tested it for that?
it was being populated by .Select(x=>x.Title.Substring(0,1) so there would only be one character. '#' is being added to the list at list[0]. that is the correct behavior.
as for the answer... that's exactly what i needed and I don't believe that i didn't see it myself. Like i said, a simple answer that i was just missing. Thanks for the help.
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.
One of a set of tools we're offering as a way to say thank you for being a part of the community.
For the digits, you could always do
Open in new window
and then it would work if the rest of the code works.
Open in new window