Searching for "-" in a string

I can’t seem to successfully search for a dash within a string. I’ve tried with and without using toString, with and without quotes around the “-”, trying to count a split string, but I absolutely can’t detect the dash in any way.

Ultimately I want to see if an input has a dash, and if it does, leave the string as-is. If it does not, than add a letter plus a dash before the input, then pass that into a search.

If Input = “56”, output should be “M-56”
if Input = "M-25, output should be “M-25”

The letter will change from time to time. It either always ads the “M-” or never does, depending on my function attempt.

Screenshot 2024-03-26 170319




I think there should be a semicolon after the closing bracket of the contains function.

3 Likes