linurgy 0.6.0

Manipulate the output of multiple newlines. Replace/Insert/Append newlines with text. Input and output from stdio/files/buffers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Replace all newlines with a dash
fn main() {
    let editor = linurgy::factory::replacer("-", 1);

    let input = "example line\nanother line";

    let output = editor.edit(input);

    let expected = "example line-another line";

    assert_eq!(expected, output);

    println!("input:\n{}\noutput:\n{}", input, output);
}