d0n Posted February 6, 2008 Posted February 6, 2008 what command should i look at if i want to count the number of upper case letter within a string?
Developers Jos Posted February 6, 2008 Developers Posted February 6, 2008 Should be possible with StringReplace()... 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.
Xenobiologist Posted February 6, 2008 Posted February 6, 2008 Hi, Global $test = "Hello WOrld" MsgBox(0,"",_getCountUpperChars($test)) Func _getCountUpperChars($string) Local $count = StringRegExp($string, '[A-Z]', 3) If @error Then Return 0 Return UBound($count) EndFunc ;==>_getCountUpperChars Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Valuater Posted February 6, 2008 Posted February 6, 2008 Another approach... Local $Count = 0 $String = "This is a Test for Autoit String Results" $Split = StringSplit($String, "") For $x = 1 To $Split[0] If StringIsUpper($Split[$x]) Then $Count += 1 Next MsgBox(0x0, "Counter", "String uppercase count is: " & $Count & " ") Although, StringRegExpress is a better way ( many here dont know how to use it!!!... 8)
Xenobiologist Posted February 6, 2008 Posted February 6, 2008 wow that was quick, thanksWelcome! Never needed something like that before Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
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