Raised This Month: $ Target: $400
 0% 

Copy one part of a string into another


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-28-2007 , 12:43   Re: Copy one part of a string into another
Reply With Quote #2

Code:
new string1[]= "AA=hi,BB=hello,CC=hey,DD=sup,EE=anotherhi" new string2[10] find_value(string1, "CC", string2, 9) find_value(in_string[], _for[], value[], outlen) {     new len = strlen(in_string), len2 = strlen(_for)     new pos, templen         while ( pos != len - len2 ) {         if ( equal(in_string[pos], _for, len2) ) {             pos += len2 + 1             while ( in_string[pos] != ',' && templen < outlen && pos < len ) {                 value[templen] = in_string[pos]                 templen++                 pos++             }             break         }         pos++     } }

Last edited by [ --<-@ ] Black Rose; 01-28-2007 at 14:45.
[ --<-@ ] Black Rose 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 00:34.


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