• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

5.2 The string type and its double quoted syntax
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • SWI-Prolog extensions
        • The string type and its double quoted syntax
          • Predicates that operate on strings
          • Representing text: strings, atoms and code lists
          • Adapting code for double quoted strings
          • Why has the representation of double quoted text changed?
    • Packages
(+String, ?Before, ?Length, ?After, ?SubString)
This predicate is functionally equivalent to sub_atom/5, but operates on strings. Note that this implies the string input arguments can be either strings or atoms. If SubString is unbound (output) it is unified with a string. The following example splits a string of the form <name>=<value> into the name part (an atom) and the value (a string).
name_value(String, Name, Value) :-
    sub_string(String, Before, _, After, "="),
    !,
    sub_atom(String, 0, Before, _, Name),
    sub_string(String, _, After, 0, Value).
atomics_to_string(+List, -String)
List is a list of strings, atoms, or number types. Succeeds if String can be unified with the concatenated elements of List. Equivalent to atomics_to_string(List,’’, String).
atomics_to_string(+List, +Separator, -String)
Creates a string just like atomics_to_string/2, but inserts Separator between each pair of inputs. For example:
?- atomics_to_string([gnu, "gnat", 1], ', ', A).
A = "gnu, gnat, 1"
string_upper(+String, -UpperCase)
Convert String to upper case and unify the result with UpperCase.
string_lower(+String, LowerCase)
Convert String to lower case and unify the result with LowerCase.
read_string(+Stream, ?Length, -String)
Read at most Length characters from Stream and return them in the string String. If Length is unbound, Stream is read to the end and Length is unified with the number of characters read.
read_string(+Stream, +SepChars, +PadChars, -Sep, -String)
Read a string f
ClioPatria (version V3.1.1-40-g9d9e003)