ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:strsplit

This is an old revision of the document!


StrSplit

str, str StrSplit(str s, str separator)

Description

Finds the first instance of separator and returns text before and after the separator. If the separator is not found, returns (s, "").

Examples

StrSplit("abcdefghi", "def");
r1 -> "abc"
r2 -> "ghi"

StrSplit("defghi", "def"); // Nothing before separtor
r1 -> "";
r2 -> "ghi";

StrSplit("abcdef", "def"); // Nothing after separator
r1 -> "abc";
r2 -> "";

StrSplit("abc", "def"); // Not found
r1 -> "abc";
r2 -> "";

See also

functions/strsplit.1492427078.txt.gz · Last modified: 2017/04/17 14:04 by korshun