From 7eac08335f61dc6b0f236f9bf7c3ad434576b70f Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 26 Nov 2018 20:46:03 +0200 Subject: Doc update on split(). --- doc/gawk.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'doc/gawk.texi') diff --git a/doc/gawk.texi b/doc/gawk.texi index 50555f8a..aea89d75 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -8105,7 +8105,6 @@ FPAT = "([^,]*)|(\"[^\"]+\")" Finally, the @code{patsplit()} function makes the same functionality available for splitting regular strings (@pxref{String Functions}). - @node Testing field creation @section Checking How @command{gawk} Is Splitting Records @@ -18406,8 +18405,8 @@ whitespace goes into @code{@var{seps}[@var{n}]}, where @var{n} is the return value of @code{split()} (i.e., the number of elements in @var{array}). -The @code{split()} function splits strings into pieces in a -manner similar to the way input lines are split into fields. For example: +The @code{split()} function splits strings into pieces in the same way +that input lines are split into fields. For example: @example split("cul-de-sac", a, "-", seps) @@ -18443,6 +18442,8 @@ are separated by runs of whitespace. Also, as with input field splitting, if @var{fieldsep} is the null string, each individual character in the string is split into its own array element. @value{COMMONEXT} +Additionally, if @var{fieldsep} is a single-character string, that string acts +as the separator, even if its value is a regular expression metacharacter. Note, however, that @code{RS} has no effect on the way @code{split()} works. Even though @samp{RS = ""} causes the newline character to also be an input -- cgit v1.2.3