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

5.2.1 Predicates that operate on strings
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • SWI-Prolog extensions
        • The string type and its double quoted syntax
          • Predicates that operate on strings
            • atom_string/2
            • number_string/2
            • term_string/2
            • term_string/3
            • string_chars/2
            • string_codes/2
            • text_to_string/2
            • string_length/2
            • string_code/3
            • get_string_code/3
            • string_concat/3
            • split_string/4
            • sub_string/5
            • atomics_to_string/2
            • atomics_to_string/3
            • string_upper/2
            • string_lower/2
            • read_string/3
            • read_string/5
            • open_string/2
    • Packages
Availability:built-in
number_string(?Number, ?String)
Bi-directional conversion between a number and a string. At least one of the two arguments must be instantiated. Besides the type used to represent the text, this predicate differs in several ways from its ISO cousin:143Note that SWI-Prolog's syntax for numbers is not ISO compatible either.

  • If String does not represent a number, the predicate fails rather than throwing a syntax error exception.
  • Leading white space and Prolog comments are not allowed.
  • Numbers may start with '+' or '-'.
  • It is not allowed to have white space between a leading '+' or '-' and the number.
  • Floating point numbers in exponential notation do not require a dot before exponent, i.e., "1e10" is a valid number.
ClioPatria (version V3.1.1-51-ga0b30a5)