ValdeZ Posted March 22, 2007 Share Posted March 22, 2007 (edited) I have symbols for example 123456qwert and I would like them to form a123b345c6qwdert So I'd like to arrange these numbers and letters to some kind slots, and then add a letter in front of every "slot". Any commands etc. which would help me? Edited March 22, 2007 by ValdeZ Link to comment Share on other sites More sharing options...
SadBunny Posted March 22, 2007 Share Posted March 22, 2007 I have symbols for example 123456qwert and I would like them to form a123b345c6qwdertSo I'd like to arrange these numbers and letters to some kind slots, and then add a letter in front of every "slot".Any commands etc. which would help me?Do you mean, split the string up in parts of 3 and add characters between them? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
ValdeZ Posted March 22, 2007 Author Share Posted March 22, 2007 Do you mean, split the string up in parts of 3 and add characters between them?Exactly. Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 22, 2007 Share Posted March 22, 2007 Exactly.Hi,have a look at StringSplit, StringMid, StringLeft and so on.So long,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 Link to comment Share on other sites More sharing options...
SadBunny Posted March 22, 2007 Share Posted March 22, 2007 Exactly. This what you mean? (Next time, please show what you tried yourself!) $insertChr = 65 $s = "123456qwert" $result = "" While StringLen($s)>3 $result &= Chr($insertChr) & _trim($s,3) $insertChr += 1 WEnd $result &= Chr($insertChr) & $s MsgBox (0, "test", "Result: "&$result) Exit Func _trim(ByRef $string,$count) $ret = StringLeft($string,$count) $string = StringTrimLeft($string,$count) Return $ret EndFunc Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
ValdeZ Posted March 22, 2007 Author Share Posted March 22, 2007 SadBunny I had no idea how I supposed to do that, but now I managed easily with StringMid (Thanks Mega). But anyway thanks 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