Delete underscore from string
#2

pawn Код:
stock Underscore(name[])
{
    for(new i = 0, j = strlen(name); i != name; i++)
    {
        if (name[i] == '_') //
        {
            name[i] = ' ';
            break;
        }
    }
    return name;
}
If you delete the break, then all _ will be replaced, otherwise only first one. Also "_" is not equal to '_'. "_" is in fact string, array of 2 elements '_', '\0', and you need only character, so use single quotes
Reply


Messages In This Thread
Delete underscore from string - by Garwan50 - 15.08.2013, 12:44
Re: Delete underscore from string - by Misiur - 15.08.2013, 12:54
Re : Delete underscore from string - by Garwan50 - 15.08.2013, 13:12
Re: Delete underscore from string - by Jefff - 15.08.2013, 14:55
Re: Delete underscore from string - by Alexis1999 - 15.08.2013, 15:11
Re : Re: Delete underscore from string - by Garwan50 - 15.08.2013, 15:28
Re: Re : Re: Delete underscore from string - by Djole1337 - 15.08.2013, 15:30
Re : Delete underscore from string - by Garwan50 - 15.08.2013, 15:48
Re: Delete underscore from string - by MSuperXX - 15.08.2013, 15:55
Re : Delete underscore from string - by Garwan50 - 15.08.2013, 18:16

Forum Jump:


Users browsing this thread: 4 Guest(s)