Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

DP QC TOKENIZEBYSEPARATOR

From Quake Wiki

Revision as of 02:17, 25 March 2013 by Hectate (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Builtin definitions:

float(string s, string separator1, ...) tokenizebyseparator = #479;

This function returns tokens separated by any of the supplied separator strings, example:

numnumbers = tokenizebyseparator("10.2.3.4", ".");

Returns 4 and the tokens are "10" "2" "3" "4"

Possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000").