parse string with delimeter
Hello. I searched parse function with delimeter like parse() but not found. Maybe there is a ready function?
I'm need function like this: parse2(text[], delimeter[1], arg1, len1, arg2, len2, ...) |
Re: parse string with delimeter
Use strtok().
|
Re: parse string with delimeter
Exolent[jNr] Thx for help.
I did not know how to do function with dynamic number of arguments (searched best way but not found) therefore I did fuction with fixed number of arguments. Probable it will be useful for somebody. Example: PHP Code:
|
Re: parse string with delimeter
Untested:
Code:
stock parsetok(const text[], token='', trimSpaces=0, ...) |
Re: parse string with delimeter
Quote:
You must give a character or number. EDIT: Here's my version without limits within the function: Code:
|
Re: parse string with delimeter
Exolent[jNr] I tried but for me dont works correctly.
PHP Code:
new iArgStringIndex = 3; new iArgLenIndex = 4; iArgStringIndex += 2; iArgLenIndex += 2; Exolent[jNr] Big thanks :) This way works is a little faster than with strtok |
Re: parse string with delimeter
Quote:
Code has been fixed. |
Re: parse string with delimeter
Also it is necessary to add
PHP Code:
|
Re: parse string with delimeter
Quote:
|
Re: parse string with delimeter
Quote:
|
| All times are GMT -4. The time now is 11:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.