Jump to content

I think this is an easy one


Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...