Error
#3

Quote:
Originally Posted by dEcooR
Посмотреть сообщение
Can you put here full stock pls
pawn Код:
stock strreplace( string[ ], const search[ ], const replacement[ ], bool:ignorecase = false, pos = 0, limit = -1, maxlength = sizeof( string ) )
{
    if( limit == 0 )
        return 0;

    new sublen = strlen( search ), replen = strlen( replacement ), bool:packed = ispacked( string ),
        maxlen = maxlength, len = strlen( string ), count = 0;

    if( packed )
        maxlen *= 4;

    if( !sublen )
        return 0;

    while( -1 != ( pos = strfind( string, search, ignorecase, pos ) ) )
    {
        strdel( string, pos, pos + sublen );

        len -= sublen;

        if( replen && len + replen < maxlen )
        {
            strins( string, replacement, pos, maxlength );

            pos += replen;
            len += replen;
        }

        if( limit != -1 && ++ count >= limit )
            break;
    }

    return count;
}
Reply


Messages In This Thread
Error - by DAVIDXP - 23.06.2013, 14:30
Re: Error - by dEcooR - 23.06.2013, 14:44
Re: Error - by DAVIDXP - 23.06.2013, 14:48
Re: Error - by dEcooR - 24.06.2013, 07:35

Forum Jump:


Users browsing this thread: 1 Guest(s)