Thread: ...
View Single Post
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-29-2022 , 11:29   Re: Request info
Reply With Quote #3

PHP Code:
stock Seperate_Digital_Categories(const charSeperator=' ', const szString[], szValue[], len)
{
    new 
iStrLen strlen(szString), index = -1iCounts;

    while( ++
index iStrLen )
    {
        if(!
isdigit(szStringindex ]))
        {
            continue;
        }

        
iCounts++;
    }

    if(!
iCounts)
    {
        return 
false;
    }

    const 
CATEGORY_SIZE 3;

    new 
iSkip = (iCounts CATEGORY_SIZE), iCategory CATEGORY_SIZE iSkip;

    
index = -1;
    
iCounts 0;

    while( ++
index iStrLen )
    {
        if(!
isdigit(szStringindex ]))
        {
            continue;
        }

        if(++
iCounts)
        {
            if(
iCounts len)
            {
                
szValueiCounts-] = szStringindex ];
                break;
            }

            
szValueiCounts-] = szStringindex ];

            if((++
iCategory CATEGORY_SIZE) == 0)
            {
                
iCounts++;
                
szValueiCounts-] = charSeperator;
            }
        }
    }

    return 
true;

Tested works fine !

Output:-

Code:
test_cmd "Hello 500 and 999 + 464567"
OUTPUT: 500 999 464 567
TEST CODE :-
Spoiler
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-29-2022 at 15:15.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh