[Question] strdel(string, strfind...) ?
#3

I don't know actually.. I was just trying something out..

correction though:
pawn Код:
strdel(cname, charpos, charpos+1);
Do you know how to replace the "_" ?
Isn't there a string replace function ?


Nevermind, I figured this out:
pawn Код:
stock rpname(playerid)
{
    new cname[MAX_PLAYER_NAME], underscore;
    GetPlayerName(playerid, cname, sizeof(cname));
    underscore = strfind(cname, "_");
    if(underscore != -1)
    {
        strdel(cname, underscore, underscore+1);
        strins(cname, " ", underscore, MAX_PLAYER_NAME);
    }
    return cname;
}
Reply


Messages In This Thread
[Question] strdel(string, strfind...) ? - by Lorrden - 09.02.2011, 19:40
Re: [Question] strdel(string, strfind...) ? - by Krx17 - 09.02.2011, 20:02
Re: [Question] strdel(string, strfind...) ? - by Lorrden - 09.02.2011, 20:45
Re: [Question] strdel(string, strfind...) ? - by MadeMan - 09.02.2011, 20:58
Re: [Question] strdel(string, strfind...) ? - by randomkid88 - 09.02.2011, 21:12
Re: [Question] strdel(string, strfind...) ? - by Lorrden - 09.02.2011, 22:11
Re: [Question] strdel(string, strfind...) ? - by Krx17 - 10.02.2011, 02:04
Re: [Question] strdel(string, strfind...) ? - by randomkid88 - 10.02.2011, 02:10

Forum Jump:


Users browsing this thread: 2 Guest(s)