Using an If to check that a string contains a certain substring

See also Selenium IDE string operations with executeScript_Sandbox - it has examples for removing characters from string.