check if a string is inside another ph code example
Example 1: javascript check if in array
var extensions = ["image/jpeg","image/png","image/gif"];
if(extensions.indexOf("myfiletype") === -1){
alert("Image must be .png, .jpg or .gif");
}
Example 2: python check if value in string
def is_value_in_string(value: str, the_string: str):
return value in the_string.lower()