A.49 library(strings): String utilities
AllApplicationManualNameSummaryHelp

  • 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)
Sourcededent_lines(+In, -Out, +Options)
Remove shared indentation for all lines in a string. Lines are separated by "\n" -- conversion to and from external forms (such as "\r\n") are typically done by the I/O predicates. A final "\n" is preserved.

Options:

tab(N)
Assume tabs at columns of with N. When omitted, tabs are taken literally and only exact matches are removed.
chars(CodesOrString)
Characters to remove. This can notably be used to remove additional characters such as * or‘|‘. Default is " \t".