Raised This Month: $ Target: $400
 0% 

[Requesting Add AMXX] Some Usefull String Functions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 06-06-2004 , 00:58   [Requesting Add AMXX] Some Usefull String Functions
Reply With Quote #1

I Think these stocks should be added in teh string.inc

Quote:
Originally Posted by Johnny got his gun
Code:
stock trim(stringtotrim[], len, charstotrim, bool:fromleft = true) {     if (charstotrim <= 0)         return     if (fromleft) {         new maxlen = strlen(stringtotrim)         if (charstotrim > maxlen)             charstotrim = maxlen         format(stringtotrim, len, "%s", stringtotrim[charstotrim])     } else {         new maxlen = strlen(stringtotrim) - charstotrim         if (maxlen < 0)             maxlen = 0         format(stringtotrim, maxlen, "%s", stringtotrim)     } }
Quote:
Originally Posted by xeroblood
Code:
stock StringMid( oldmsg[], newmsg[], start, end ) {     new len = strlen( oldmsg )     if( start < 0 ) start = 0     if( end <= start || end > len ) end = len     for( new j = 0, i = start; i < end; j++, i++ )         newmsg[j] = oldmsg[i]     return }
Quote:
Originally Posted by xeroblood
Code:
stock explode( output[][], input[], delimiter ) {         new nIdx = 0     new nLen = (1 + copyc( output[nIdx], MAX_STR_LEN-1, input, delimiter ))         while( nLen < strlen(input) )         nLen += (1 + copyc( output[++nIdx], MAX_STR_LEN-1, input[nLen], delimiter )) }
__________________
My Plugins

Got ??
AssKicR is offline
 



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 14:47.


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