1if (newStr4.startsWith("Mon") || newStr4.startsWith("Tues") || ...)
2
3Or you could use regular expression:
4
5if (newStr4.matches("(Mon|Tues|Wed|Thurs|Fri).*"))
1hi hi I tried this in Groovvy
2["Mon","Tues","Wed","Thurs"].any { newStr.startsWith(it) }
3
4hope it helps
1//There is NO possibility to passing an Array
2//like startsWith(["Mon" | "Tues"])
3if (newStr4.startsWith("Mon") || newStr4.startsWith("Tues") || ...)
4
5//although you can use regular expression,
6//but performance are lower than the solution above
7 if (newStr4.matches("(Mon|Tues|Wed|Thurs|Fri).*"))