Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Liberty Unleashed
Scripting
»
Script Help
»
Replace one letter with another in the string
Home
Help
Search
Calendar
Media
Login
Register
« previous
next »
Print
Pages: [
1
]
Author
Topic: Replace one letter with another in the string (Read 2766 times)
ZX_Lost_Soul
Newbie
Posts: 25
Karma: +1/-1
Replace one letter with another in the string
«
on:
November 07, 2013, 07:42:58 am »
Code:
[Select]
txt="Sometext";
How to replace a letter in the string? I try:
Code:
[Select]
txt[1]=3;
txt[1]='c';
txt[1]="c";
local letter="c";
txt[1]=letter.tochar();
...but nothing works(
Maybe Squirel have analog of
str_replace()
?
«
Last Edit: November 07, 2013, 08:05:38 am by ZX_Lost_Soul
»
Logged
My English is very poor, please try to understand me)
Benedani
Newbie
Posts: 17
Karma: +2/-0
Re: Replace one letter with another in the string
«
Reply #1 on:
August 20, 2015, 06:01:40 pm »
Strings are not arrays. This example wouldn't work. You'll have to create the modified string yourself.
Logged
PerikiyoXD
Newbie
Posts: 15
Karma: +3/-2
DUUH DO IT NOW!
Re: Replace one letter with another in the string
«
Reply #2 on:
August 20, 2015, 11:43:21 pm »
isnt a string a char array?
Logged
Print
Pages: [
1
]
« previous
next »
Liberty Unleashed
»
Scripting
»
Script Help
»
Replace one letter with another in the string
Loading...