Hello,
I have a script with an if (expression), which has a repeated part, str3 !=.
If (str3 != "Jan") && (str3 != "Feb") && (str3 != "Mar") && (str3 != "Apr") && (str3 != "May") && (str3 != "Jun") && (str3 != "Jul") && (str3 != "Aug") && (str3 != "Sep") && (str3 != "Oct") && (str3 != "Nov") && (str3 != "Dec")
I know that the following is NOT working. Is there any way to simplify it?
If (str3 != ("Jan" && "Feb" && "Mar" && "Apr" && "May" && "Jun" && "Jul" && "Aug" && "Sep" && "Oct" && "Nov" && "Dec"))
Thank you.
How to make if (expression) with repeated part concise Topic is solved
Re: How to make if (expression) with repeated part concise Topic is solved
regular expression.
if !(str ~= "^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)$")
if !(str ~= "^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)$")
Re: How to make if (expression) with repeated part concise
Wow, awesome! Thank you @thqby