Raised This Month: $ Target: $400
 0% 

Adding to String


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-12-2009 , 19:35   Re: Adding to String
Reply With Quote #2

Code:
new szFirst[7];
copy( szFirst, 6, String );

new location = contain( szFirst, "3");
if( location != -1 )
   szFirst[location+1] = 0;

format( String, 6, "%s-%s", szFirst, String[location+1] );
Can't really think of a better way to do it. Need a little more information on what you really want.

Could also do something like:
Code:
new szCopy[7];
for( new i; i<sizeof String; i++ ){
   if( i == desired_location )
     szCopy[i++] = '-';
   szCopy[i] = String[i];
}
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
 



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 09:03.


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