str_replace, how to change char.
#7

PHP код:
    new sFind[][] = {"ą""ć"};
    new 
sReplace[][] = {"a""c"};
    new 
sSubject[500] = "Asią byla ćasna.";
    
printf("Old string: %s"sSubject);
    for(new 
0sizeof(sFind); i++)
    {
        
sSubject str_replace(sFind[i], sReplace[i], sSubject);
    }
    
printf("New string: %s"sSubject); 
Here you go, as you wanted it. Obviously play around with the size of the `sSubject` string.

Regarding where to find strlib: https://sampforum.blast.hk/showthread.php?tid=85697

To add any other replacements, simply add it to the arrays.
Reply


Messages In This Thread
str_replace, how to change char. - by Zamek - 02.08.2017, 20:55
Re: str_replace, how to change char. - by Zamek - 03.08.2017, 12:46
Re: str_replace, how to change char. - by Hansrutger - 03.08.2017, 12:59
Re: str_replace, how to change char. - by OsteeN - 03.08.2017, 12:59
Re: str_replace, how to change char. - by Hansrutger - 03.08.2017, 13:01
Re: str_replace, how to change char. - by Zamek - 03.08.2017, 13:26
Re: str_replace, how to change char. - by OsteeN - 03.08.2017, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)