What you describe isn't a grooming issue, but, as you suspect, a nervous habit. It could be a simple absent-minded behavior akin to picking your nose at the stop light, or a more serious obsessive-compulsive disorder along the lines of pica or trichotillomania. I don't know her, and even if I did, I'm not a doctor, so I can only guess.
How you approach it depends on how close you two are. You could bring it up with her if you feel comfortable and if you believe it's something she does without thinking. If she has other symptoms of OCD, though, this could be a serious impulse-control disorder, not something she does because she thinks it's okay to eat dandruff out of her hair. If that is the case, telling her that it's gross and that it will drive potential boyfriends away won't do anything but hurt her feelings. She needs behavior therapy, not condemnation.
If the hair-picking completely grosses you out, you could ask her not to do it in front of you. She probably won't like that, but you have a right not to have to see it. In your shoes, I would probably just let it go, but then, it takes a lot to skeeve me. I just don't know that you'll be able to make her stop. You have to decide if hurting her feelings is worth the risk of saying something.
Thanks for the question.
I read this as crumbs meaning food, but I guess it being dandruff explains the concern!
I don't think presenting it as 'you won't get a boyfriend because of this gross habit' is the best way of putting it, her lack of boyfriend will probably be something she's insecure about so highlighting it may seem catty and make her feel undesirable.
Perhaps a better approach would be along the lines of 'this isn't normal behaviour and we're worried about you, you need to sort out the cause of it'
I'm assuming it's dandruff. That's the only thing that makes sense. Who walks around with food crumbs in their hair?
The only way to do this is tell one of her closest family members and have them tell her. Family can only tell you truth and even if it hurts, you can take the truth better.
Im close to my siblings and they help point out all my wrongs and for GOOD reasons. And theres no hard feelings, Well...at least I dont take it that hard because family is family.
You could say something like "I was reading this book/watching this show about obsessive compulsive disorder, and..."
Of course at this point it would be good to read up on obsessive compulsive disorder so you could point out a few things that people do. Heck, a lot of people have mild OCD symptoms. You could even mention something that you do that might seem a bit OCD. Then mention the picking thing you have seen her do with the hair. That might ease into the conversation a little better.
My OCD involves counting and hoarding (items, not animals.) I did not know I had OCD until I was in my 40's. It was such a relief to be able to give a name to what was going on with me. To make matters worse it's combined with bipolar disorder and borderline personality disorder but now that I know I can learn about and combat the problem. Your friend may take solace in the ability to do this too.