Raised This Month: $ Target: $400
 0% 

Read multiple Integers from one String


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-07-2006 , 09:11   Re: Read multiple Integers from one String
Reply With Quote #2

Two ways:

Code:
new string[64] = "123#456#789"; new splitString[12]; new num1, num2, num3; strtok(string, splitString, 11, string, 63, '#'); num1 = str_to_num(splitString); strtok(string, splitString, 11, string, 63, '#'); num2 = str_to_num(splitString); num3 = str_to_num(string);

Code:
new string[64] = "123#456#789"; new strNum1[12], strNum2[12], strNum3[12]; new num1, num2, num3; replace_all(string, 63, "#", " "); parse(string, strNum1, 11, strNum2, 11, strNum3, 11); num1 = str_to_num(strNum1); num2 = str_to_num(strNum2); num3 = str_to_num(strNum3);
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood 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 04:44.


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