Raised This Month: $ Target: $400
 0% 

Add space on string.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-11-2011 , 08:12   Re: Add space on string.
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
PHP Code:
//Change where the space is inserted if you need to
const SpacePos 3;

public 
Test() 
{
    new 
szNumber[] = "123456789123456789";
    new 
szResultNumber32 ];
    
    
SpaceNumberszNumber strlenszNumber ) , szResultNumber charsmaxszResultNumber ) );
    
    
server_print"[%s]" szResultNumber );
    
// [123 456 789 123 456 789]
}

SpaceNumberszNum[] , iLen szResult[] , iSize )
{
    new 
iNumPos iResultPos;
    
    while ( ( 
iNumPos iLen ) && ( iResultPos iSize ) )
    {
        if ( 
iNumPos && !( iNumPos SpacePos ) )
            
szResultiResultPos++ ] = ' ';
            
        
szResultiResultPos++ ] = szNumiNumPos++ ];
    }

Thanks you very much bugsy , i go to test later.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode