pstrsplit, pstrcsplit, pstrresplit - split a string on a character, string or regexp. |
#include <pstring.h> vector pstrsplit (pool, const char *str, const char *sep); vector pstrcsplit (pool, const char *str, char c); vector pstrresplit (pool, const char *str, const regex_t *re); |
These functions split string str on either a string sep, a character c or a regular expression re. |
The result is a vector of newly created substrings. |
Perl's split function treats zero-length strings differently from other strings -- returning an empty vector (rather than returning a vector containing a single zero-length string which is what you might expect, and is slightly more orthogonal). The author has not decided what the correct behaviour should be, so treat this case as undefined in the current release. |
Richard Jones <rich@annexia.org> |
GNU LGPL (see http://www.gnu.org/) |
c2lib-1.2.13 |