Renderer Posted December 13, 2016 Share Posted December 13, 2016 Hello guys ! I've got the following array containing 2 strings : local $string[3] = ["HELLO","WORLD"] How can i split each string and return the ASCII of each character? Thanks in advance Link to comment Share on other sites More sharing options...
Jfish Posted December 13, 2016 Share Posted December 13, 2016 You could loop something like this through the array: #include <Array.au3> $string="hello" $split=StringSplit($string,'') _ArrayDisplay($split) Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
mikell Posted December 13, 2016 Share Posted December 13, 2016 #include <Array.au3> local $string[3] = ["HELLO","WORLD"] For $i = 0 to UBound($string)-1 $split = StringSplit($string[$i], "") If $string[$i] = "" Then ContinueLoop For $j = 1 to $split[0] $split[$j] = Asc($split[$j]) Next _ArrayDisplay($split) Next Link to comment Share on other sites More sharing options...
iamtheky Posted December 13, 2016 Share Posted December 13, 2016 #include<array.au3> local $aString[2] = ["HELLO","WORLD"] _ArrayDisplay(StringToASCIIArray(_ArrayToString($aString , ""))) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Gianni Posted December 13, 2016 Share Posted December 13, 2016 Local $string[3] = ["HELLO", "WORLD"] For $Element In $string For $chr In StringSplit($Element, '', 2) ConsoleWrite($chr & @TAB & Asc($chr) & @CRLF) Next ; ConsoleWrite(@CRLF) Next kylomas 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... 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