Bugfix / refactored function in string validation helper

Refactored function containsString