Sign in to follow this  
Followers 0
Hell4Ge

How to cut some chars from middle of string?

6 posts in this topic

Like in C++ that was pretty easy (string a="asdsd"; // a[4]='d'), that I cant make it to work in AU

Any ideas?

Share this post


Link to post
Share on other sites



Check out:

StringToASCIIArray()

StringFromASCIIArray()

Asc()

Example:

$string = "asdasd"
ConsoleWrite($string&@CRLF)
$nString = StringToASCIIArray($string)
$nString[3] = Asc("d")
$string = StringFromASCIIArray($nString)
ConsoleWrite($string&@CRLF)

Hope it helps :)


[spoiler]My UDFs: Login UDF[/spoiler]

Share this post


Link to post
Share on other sites

It will

Thanks :)

Share this post


Link to post
Share on other sites

You could also use the StringSplit function or StringMid function.

$sString = "abcdefg"
$sString = StringLeft($sString, 3) & "z" & StringMid($sString, 5)
ConsoleWrite($sString & @CRLF)

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

MsgBox(0,  'Yes?', StringReplace("asdsd", 4, "d"))
Nice. I never used StringReplace like that. It seems the old pal "RTFM" is still around. :)

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

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  
Followers 0