Skip to main content

Module lines

Module lines 

Source
Expand description

Provides structure to iterate over lines within a string, or block of text, that includes new-line separators.

Depends on IterateStringCharacters

§Example

use iterate_text::string::lines::IterateStringLines;

let s = String::from("This is\na \\n test string\n");
let mut l = IterateStringLines::new(s);

assert_eq!(l.next(), Some("This is\n".to_string()));
assert_eq!(l.next(), Some("a \\n test string\n".to_string()));
assert_eq!(l.next(), None);

Structs§

IterateStringLines
Iterates over lines within string and includes new-line separator