• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
        • Charset-p
        • Strtok!
        • Cases
        • Concatenation
        • Html-encoding
        • Character-kinds
        • Substrings
        • Strtok
        • Equivalences
        • Url-encoding
        • Lines
          • Strlines
          • Prefix-lines
          • Strline
        • Ordering
        • Numbers
        • Pad-trim
        • Coercion
        • Std/strings-extensions
        • Std/strings/digit-to-char
        • Substitution
        • Symbols
      • Std/io
      • Std/osets
      • Std/system
      • Std/basic
      • Std/typed-lists
      • Std/bitsets
      • Std/testing
      • Std/typed-alists
      • Std/stobjs
      • Std-extensions
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
  • Std/strings

Lines

Functions for operating on the lines of a string.

Note that these functions generally work with Unix-style newline characters, i.e., \n instead of something like \r\n. Depending on your application, this may or may not be appropriate.

One option for treating a string as lines is to just use, e.g., strtok to literally split it into a list of lines. The functions here are generally meant to be more efficient, e.g., prefix-lines can add a prefix to every line without constructing an temporary string list or doing any intermediate string concatenation.

Subtopics

Strlines
Extract a group of lines from a string by their line numbers.
Prefix-lines
Add a prefix to every line in a string.
Strline
Extract a line from a string by its line number.