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)
Sourceinterpolate_string(:In, -Out, +Map, +Options)
Establish a string from a template by replacing patterns. Supported patterns are:
{Name}
If Map contains Name=Value, insert Value using write/1. If Name does not appear in Map, raise an existence error. Name must satisfy the rules for a Prolog variable.
{Name,Default}
As above, but if Name does not appear in Map, use Value
{@(Goal)}
Insert the output (to current_output) of Goal here. For safety reasons only accepted if Options contains goals(true)