chinotto 1 Posted March 16, 2016 Report Share Posted March 16, 2016 (edited) Is it possible to make contains function case insensitive? I got the following code: set(#var,%nte,"Global") if($contains(#var,"Point")) { then { alert("contains!") } else { alert("Does not contain") } }So I have the list "%nte" and set it as the variable #var. The list contains the word Point. I would like to alert "contains! even if I search for the word "point" with lowercase p in the variable or any other lower and uppercase mix like "PoInT". Now it only shows "contains!" alert if I search for Point with the uppercase P. Edited March 16, 2016 by chinotto Quote Link to post Share on other sites
pash 504 Posted March 16, 2016 Report Share Posted March 16, 2016 set(#MyVar,"point","Global") if($comparison($find regular expression(#MyVar,"(?i)Point"),"!= Does not equal","")) { then { alert("contains!") } else { alert("Does not contain") } } set(#MyVar,"Point","Global") if($comparison($find regular expression(#MyVar,"(?i)Point"),"!= Does not equal","")) { then { alert("contains!") } else { alert("Does not contain") } } set(#MyVar,"We\'ve done everything we point 123","Global") if($comparison($find regular expression(#MyVar,"(?i)Point"),"!= Does not equal","")) { then { alert("contains!") } else { alert("Does not contain") } } 2 Quote Link to post Share on other sites
chinotto 1 Posted March 16, 2016 Author Report Share Posted March 16, 2016 (edited) Perfect!! Thank you so much Pash!! This is exactly what I was looking for: set(#MyVar,"We\'ve done everything we point 123","Global") if($comparison($find regular expression(#MyVar,"(?i)Point"),"!= Does not equal","")) { then { alert("contains!") } else { alert("Does not contain") } }Thanks again! Edited March 16, 2016 by chinotto 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted March 16, 2016 Report Share Posted March 16, 2016 Nice Pash! here is the more versatile function for this, this way you can use for any word. alert($is in text("We\'ve done everything we point 123", "Point"))alert($is in text("We\'ve done everything we Point 123", "bob"))define $is in text(#TEXT TO CHECK, #TEXT TO SEARCH) { if($comparison($find regular expression(#TEXT TO CHECK,"(?i){#TEXT TO SEARCH}"),"!= Does not equal",$nothing)) { then { return("true") } else { return("false") } }} CD 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.