I\'m using C# and I want to check if a string contains one of ten characters, *, &, # etc etc.
What is the best way?
Thanks to all of you! (And Mainly Jon!): This allowed me to write this:
private static readonly char[] Punctuation = "$€£".ToCharArray();
public static bool IsPrice(this string text)
{
return text.IndexOfAny(Punctuation) >= 0;
}
as I was searching for a good way to detect if a certain string was actually a price or a sentence, like 'Too low to display'.