Reinhardt1julian Posted February 21, 2013 Share Posted February 21, 2013 I want to check if there are numbers 2x (or 3x) in a variable, for example for$var = 47253it should return false or 0. For$var = 47252 or $var = 47242it should return true or 1. And for$var = 47222it should return false or 0If that's not possible, I want to check for the number of strings in a function, for example if i have$var = 58355I want to check for 5 in this variable, and it should return 3. For$var = 73642Check for 7 it should return 1 Link to comment Share on other sites More sharing options...
Developers Jos Posted February 21, 2013 Developers Share Posted February 21, 2013 Why return 0 for $var = 47222 when the condition is 2 or 3 times the same number? Anyway what have you tried ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PhoenixXL Posted February 22, 2013 Share Posted February 22, 2013 Not able to verify the condition of the First part Here is the Example for the second partFunc _Occurance($String, $SubString) StringRegExpReplace($String, StringRegExpReplace($SubString, "(\W)", "[\1]"), "") Return @extended EndFunc ;==>_Occurance MsgBox(0, "Return:", _Occurance(58355, 5)) MsgBox(0, "Return:", _Occurance(73642, 7)) My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now