Copyright (c) 1993 The Regents of the University of California.
Copyright (c) 1994-1996 Sun Microsystems, Inc.
See the file "license.terms" for information on usage and redistribution
of this file, and for a DISCLAIMER OF ALL WARRANTIES.
RCS: @(#) $Id: split.n,v 1.3.18.1 2004/10/27 14:23:58 dkf Exp $
.so man.macros
Returns a list created by splitting string at each character that is in the splitChars argument. Each element of the result list will consist of the characters from string that lie between instances of the characters in splitChars. Empty list elements will be generated if string contains adjacent characters in splitChars, or if the first or last character of string is in splitChars. If splitChars is an empty string then each character of string becomes a separate element of the result list. SplitChars defaults to the standard white-space characters.
See how the split command splits on every character in splitChars, which can result in information loss if you are not careful: .CS split "alpha beta gamma" "temp" => al {ha b} {} {a ga} {} a .CE
Extract the list words from a string that is not a well-formed list: .CS split "Example with {unbalanced brace character" => Example with \\{unbalanced brace character .CE
Split a string into its constituent characters .CS split "Hello world" {} => H e l l o { } w o r l d .CE