A tool that beautify multiple lines. * Trim first line if empty * Trim min indent
What you need str:
rust
hello
world
You had to do:
rust
let s = "hello
world";
println!("{}",s);
Now you can:
rust
let s = "
hello
world";
println!("{}",pure_lines::pure(s));
``` rust use pure_lines;
fn main(){ let a = " hello world"; println!("=============="); println!("before:"); println!("{}",&a); println!("=============="); let s = pure_lines::pure(a); println!("after:"); println!("{}",s); println!("==============");
// Output:
// ==============
// before:
//
// hello
// world
// ==============
// after:
// hello
// world
// ==============
} ```
``` rust use pure_lines;
fn main(){ let a = " hello world"; println!("=============="); println!("before:"); println!("{}",&a); println!("=============="); let s = purelines::purewith(a,"> "); println!("after:"); println!("{}",s); println!("==============");
// Output:
// ==============
// before:
//
// hello
// world
// ==============
// after:
// > hello
// > world
// ==============
} ```