I want to find out, whether my string contains a text like #1, #a, #abc, #123, #abc123dsds and so on... (\'#\' character with one or more characters (digits and letters).
You need to use Regex in order to use a regex pattern.
string text = "#123"; Regex rgx = new Regex("#[a-zA-Z0-9]+"); var match = rgx.Match(text); bool matche = match.Success)