| linesplit |
(String str[, int strict]) |
yoix.string |
| |
Splits the string
str
up to a first encountered
NULL
character
(\0),
if any, into an array of substrings based on any new-line character,
carriage-return character or any combinations of those characters.
Zero length results, wherever they appear, are ignored unless the optional
strict
argument is supplied as a non-zero value.
In that case, delimiters are considered to be a single new-line, a single carriage-return or
a heterogeneous pairing of both; consecutive delimiters are interpreted as bracketing a
zero-length string, which is included in the results; only a trailing zero-length string is omitted.
| |
| Example: |
The program,
import yoix.stdio.*;
import yoix.string.*;
String str = "\n\n\none\ntwo\rthree\n\rfour\r\nfive\n\n\nsix\n";
printf("%O\n", linesplit(str));
printf("%O\n", linesplit(str, TRUE));
prints
Array[6:0]
>^"one"
^"two"
^"three"
^"four"
^"five"
^"six"
Array[11:0]
>^""
^""
^""
^"one"
^"two"
^"three"
^"four"
^"five"
^""
^""
^"six"
on standard output.
| | |
| Return: |
Array
| | |
| See Also: |
csvsplit,
strjoin,
strsplit
|
|
Yoix is a registered trademark of AT&T Inc.
|