Raised This Month: $ Target: $400
 0% 

parse string from aymbols


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
faki
Senior Member
Join Date: Jul 2013
Old 05-25-2014 , 08:51   parse string from aymbols
Reply With Quote #1

I got 2 strings in formatex function with "+" symbol between.
I need to parse string 1 and string 2 in 2 new bools.
How to ?

Here is example:
new format[512]

formatex(format,511,"%s+%s",id,auth)

i need to parse id in
new ids = id
new auths = auth
+ is character that separates them.
faki is offline
c2d22
Junior Member
Join Date: Feb 2013
Location: Albania
Old 05-25-2014 , 10:39   Re: parse string from aymbols
Reply With Quote #2

You need to use , strtok .

For ur example , if

PHP Code:
new format[512] = "12+steam_0:0:24524"
new id[20] , authid[25]
strtok(format,id,charsmax(id),authid,charsmax(authid),'+')
log_amx("Id - %s  and authid - %s",id,authid
Output
PHP Code:
Id 12 and authid steam_0:0:24524 
If u want to trim both the divided part use strtok2 , because trimming is broken in strtok .

Last edited by c2d22; 05-25-2014 at 10:42.
c2d22 is offline
Reply


Thread Tools
Display Modes

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:43.


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