A.54 library(strings): String utilities
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(strings): String utilities
          • string/4
          • interpolate_string/4
          • string_lines/2
          • dedent_lines/3
          • indent_lines/3
          • indent_lines/4
    • Packages
Availability::- use_module(library(strings)).(can be autoloaded)
Sourcestring(+Content, +Args, +Binding, -DOM)
Implements the quasi quotation syntax string. If the first character of the content is a newline (i.e., there is a newline immediately after the || token) this first uses dedent_lines/3 to the remove common white space prefix from the lines. This is called with the option chars("\s\t|"), i.e., also removing | characters and tab(8).

If the quasi quotation syntax carries arguments (e.g., string(To)), the string is compiled into a function that produces the result of interpolating the arguments into the template. See user functions on dict objects. If there are no arguments, the result is simply the final string.

See also
- interpolate_string/4 for the interpolation syntax.
- Section for examples and discussion.
To be done
Specify tab width and allow for {@Goal} templates.