Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Store values into an array?

$
0
0
Hi Im using the below to count the number of times "o" repeats in my  $string "olololololol" etc

Now then I get the position of each one of those o's.

But how do I store the positions into an array??

[ autoit ]         
Func _StringCount($String, $SubString)     return (StringLen($String) - StringLen(StringReplace($String, $SubString, ""))) / StringLen($SubString) EndFunc $String = "olololololololol" $SubString = "o" MsgBox(0,"" ,  _StringCount($String, $SubString)) Local $i Local $tol = 100 For $i = 1 To 100 Step +1     Local $result = StringInStr($String, $SubString, 0, $i)         if $result == 0 Then             Exit         Else             MsgBox(0,"DEMO1", $result)         EndIf Next  

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>