Wb-FreeKill Posted June 13, 2005 Share Posted June 13, 2005 How can i split a sentence in pieces, like: "I am an idiot" split into $string1 = "I" $string2 = " " $string3 = "a" $string4 = "m" $string5 = " " ect so i can take out each letter Link to comment Share on other sites More sharing options...
Valuater Posted June 13, 2005 Share Posted June 13, 2005 How can i split a sentence in pieces, like:"I am an idiot"split into $string1 = "I"$string2 = " "$string3 = "a"$string4 = "m"$string5 = " "ectso i can take out each letter<{POST_SNAPBACK}>.... straight from help.........$result = StringLeft("I am a string", 3)MsgBox(0, "Leftmost 3 characters are:", $result)....but you knew that Link to comment Share on other sites More sharing options...
Helge Posted June 13, 2005 Share Posted June 13, 2005 Array vs variables.. you choose. ; Method #1 : Using variables ; =========================== Dim $string = "Wb-FreeKill is an idiot !", $msgText = "$string<num>" & @CRLF For $i = 1 To StringLen($string) Assign("string" & $i,StringMid($string,$i,1)) $msgText = $msgText & @CRLF & $i & " : " & StringMid($string,$i,1) Next MsgBox(64,"Variables",$msgText) ; Method #2 : Using an array ; =========================== Dim $string = "Wb-FreeKill is an idiot !", $msgText = "$array[<num>]" & @CRLF $array = StringSplit($string,"") For $i = 1 To StringLen($string) $msgText = $msgText & @CRLF & $i & " : " & $array[$i] Next MsgBox(64,"Array",$msgText) Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted June 13, 2005 Author Share Posted June 13, 2005 You guy's help are really much appriciated, i tried, i look trough the helpfile, and would rater make a quick question here instead of trieng for a long time... but it's more simple than i tought.. so stop making me look like an idiot... 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