I've a string looking like this : str = P1|P2|P3....
I need to check if the string contains for instance P1. I do that :
if (str.Contains("P1"))
{...}
My issue comes when I look for P1 and str does not contains P1 but P10, it returns true, which is logical, but not what I need.
How can I check strictly for P1 without returning true if I have P10 in the string.
Thanks for your help
stris the most logical way to be holding this data? Why are you not using some collection type which can hold multiple values?