SA-MP Forums Archive
Removal of underscores - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Removal of underscores (/showthread.php?tid=238582)



Removal of underscores - Skylar Paul - 12.03.2011

How would I go about doing so? I had a code snippet from a while ago, but I'm a bit rusty and can't re-create it.. and I seem to have lost it.


Re: Removal of underscores - bigcomfycouch - 12.03.2011

pawn Код:
for ( new i, s = strlen( string ); i < s; ++i )
    if ( string[ i ] == '_' )
        string[ i ] = ' ';



Re: Removal of underscores - Skylar Paul - 12.03.2011

Quote:
Originally Posted by bigcomfycouch
Посмотреть сообщение
pawn Код:
for ( new i, s = strlen( string ); i < s; ++i )
    if ( string[ i ] == '_' )
        string[ i ] = ' ';
And how would I go about using that with things such as GetPlayerName?

pawn Код:
stock pName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    return Name;
}
I have that, how would I go about modifying it to get rid of the _?