Foreach through lines.
#1

In PHP it goes like
PHP код:
foreach(preg_split("/((\r?\n)|(\r\n?))/"$input) as $line
Is that possible to do with PAWN? If yes, please explain and give examples.

Thank you.
Reply
#2

You can, using the regular expression plugin:

https://sampforum.blast.hk/showthread.php?tid=247893

However, I don't think you can iterate by line with foreach. You'll have to perform a complex operation with loops and such, however I do believe that I have a string line iteration function somewhere on my PC.
Reply
#3

It would be helpful and I hope to find the exact solution for that problem, I am actually trying to get content from MySQL tables and seperate it by lines.
Reply
#4

Bump.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)