Next: , Previous: guile-tools snarf-guile-m4-docs, Up: Miscellaneous Tools


13.42 guile-tools split-string-no-nulls

Usage: split-string-no-nulls STRING [SEPARATORS]

Split STRING using " \f\t\n\r\v" to find boundaries, and display
substrings one per line to stdout.  Optional arg SEPARATORS is a
string to use besides the default (you may need to quote it to
protect from the shell).  This mimics Emacs Lisp `split-string',
with the difference that when SEPARATORS is specified, Emacs
preserves nulls while `split-string-no-nulls' does not.  For
example, given the string S "abc  def" (two spaces), we see:

 Emacs (split-string S)     => ("abc" "def")
 Emacs (split-string S " ") => ("abc" "" "def")

versus

 (split-string-no-nulls S)     => ("abc" "def")
 (split-string-no-nulls S " ") => ("abc" "def")


Usage from a Scheme program:
 (split-string-no-nulls STRING [SEPARATORS])
 (split-string-no-nulls-proc SEPARATORS)

This first procedure returns the list of split strings instead of
sending them to stdout.  The second returns a procedure that takes
a string and does the splitting (use this to "compile once, use
many times").