cob007 19 Posted January 15, 2020 Report Share Posted January 15, 2020 as u can see ive the following text, ive trie to remove all spaces between them and made it like this,however when i do a comparison it does not work as a true statement is it because of the spaces between text set(#length,"OnepersonfoundthishelpfulHelpful","Global") if($comparison(#length,"= Equals","OnepersonfoundthishelpfulHelpful")) { then { alert("EXISTS") return("") }} Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 15, 2020 Report Share Posted January 15, 2020 your comparison does not have the extra line set(#length,"Onepersonfoundthishelpful Helpful ","Global") if($comparison(#length,"= Equals","Onepersonfoundthishelpful Helpful ")) { then { alert("EXISTS") return("") } } this worksRegards,Nick Quote Link to post Share on other sites
cob007 19 Posted January 16, 2020 Author Report Share Posted January 16, 2020 your comparison does not have the extra line set(#length,"Onepersonfoundthishelpful Helpful ","Global") if($comparison(#length,"= Equals","Onepersonfoundthishelpful Helpful ")) { then { alert("EXISTS") return("") } } this works Regards,Nick thanks that worked but see a case like this where its showing in my debugger and ive no idea of space in such a case, and when i try command it does not work because i dont know whats the space before and after Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 16, 2020 Report Share Posted January 16, 2020 Use the $trim function to remove space before and after. Quote Link to post Share on other sites
SourceUltra 10 Posted January 16, 2020 Report Share Posted January 16, 2020 You can also accomplish this with regex, using Heopas Regex Replace function, with the regex: /s section("Uses Heopas Regex Function") { set(#no_space,$plugin function("HeopasCustom.dll", "$Heopas Regex Replace", #length, "\\s", "", "", "False"),"Global") } and then you can use the Heopas Regex Count function with /s to count spaces 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.