str_replace, how to change char.
#6

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
Iterate through the whole sSubject and find the ones you need to change instead, that's how I would have done it at least. I don't know where you can get strlib from, the wiki page is being nab and it doesn't tell. But I'll show you how you can do it without str_replace.

Код:
for (new i = 0; i < sizeof(sSubject); i++)
{
    if (sSubject[i] == 'ą')
    {
         sSubject[i] = 'a';
    }
    else if (sSubject[i] == 'ć')
    {
         sSubject[i] = 'c';
    }
}
Replacing whole words will force you to use something like strcmp or similar. Again maybe str_replace works, I don't know because I've never seen where you could download that library from (neither have I given any effort in finding it other than trying from the wiki).
Thanks for help!
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: 2 Guest(s)