Jump to content
Sign in to follow this  
ValdeZ

I think this is an easy one

Recommended Posts

ValdeZ

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 by ValdeZ

Share this post


Link to post
Share on other sites
SadBunny

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?

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.

Share this post


Link to post
Share on other sites
ValdeZ

Do you mean, split the string up in parts of 3 and add characters between them?

Exactly.

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
Share on other sites
SadBunny

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.

Share this post


Link to post
Share on other sites
ValdeZ

SadBunny I had no idea how I supposed to do that, but now I managed easily with StringMid (Thanks Mega). But anyway thanks :whistle:

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×