Raised This Month: $ Target: $400
 0% 

first argument of the string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nepopus
Member
Join Date: Jun 2008
Location: Russia/Moscow
Old 07-20-2008 , 10:40   first argument of the string
Reply With Quote #1

hello, how can i get first argument(word) of the string if dunno what word and len here is
and second++
__________________
hi maaaaaan
my server here soon

Last edited by Nepopus; 07-20-2008 at 10:46.
Nepopus is offline
Send a message via ICQ to Nepopus Send a message via Skype™ to Nepopus
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 07-20-2008 , 13:40   Re: first argument of the string
Reply With Quote #2

How to know how long the string is without parsing each word is probably impossible.
But I would do it this way :
PHP Code:
new const string[] = "This-is-data-1 And-this-is-data2 this-isnt-parsed(3rd-word)";

static 
data1[33], data2[33];
parse(stringdata132data232);

new 
len1 sizeof(data1) - 1;
new 
len2 sizeof(data2) - 1
__________________

Last edited by atomen; 07-20-2008 at 13:46.
atomen is offline
Send a message via MSN to atomen
Nepopus
Member
Join Date: Jun 2008
Location: Russia/Moscow
Old 07-20-2008 , 13:59   Re: first argument of the string
Reply With Quote #3

Quote:
Originally Posted by atomen View Post
How to know how long the string is without parsing each word is probably impossible.
But I would do it this way :
PHP Code:
new const string[] = "This-is-data-1 And-this-is-data2 this-isnt-parsed(3rd-word)";

static 
data1[33], data2[33];
parse(stringdata132data232);

new 
len1 sizeof(data1) - 1;
new 
len2 sizeof(data2) - 1
huh i thought this fills data for a maximum of length characters, thanks
+ karma
P.S. then i need strbreak(string, data1, 32, data2, 32)
__________________
hi maaaaaan
my server here soon
Nepopus is offline
Send a message via ICQ to Nepopus Send a message via Skype™ to Nepopus
Reply



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 05:29.


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