SA-MP Forums Archive
str_replace - detect more than one character - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: str_replace - detect more than one character (/showthread.php?tid=450609)



str_replace - detect more than one character - Macronix - 13.07.2013

Hi guys,
i have a question: Is there a way to detect more than one letter/character with str_replace? I need to replace characters like "д", "ц" and "ь" and i don't know how to do that in just one "str_replace" :/

Can u help me?

- Macronix


Re: str_replace - detect more than one character - Mitchy - 13.07.2013

new
sSearch[] = "д", "ц", "ь",
sReplace[] = "a", "o", "u",
sSubject[] = "";


print("%s", str_replace(sSearch, sReplace, sSubject));





Try it, untested and idk if it works. If it doesn't I am sorry


AW: str_replace - detect more than one character - Macronix - 13.07.2013

Thanks, but it doesn't work :/
It says "error 020: invalid symbol name "" " and " error 021: symbol already defined: "" "