[−][src]Trait stripmargin::StripMargin
Required methods
pub fn strip_margin_with(&self, margin_char: char) -> String
[src]
For every line in this string, strip a leading prefix consisting of blanks or control characters,
followed by margin_char
from the line.
Examples
use stripmargin::StripMargin; assert_eq!( r#"Hello, @ world! @"# .strip_margin_with('@'), "Hello,\n world!\n", );
Please note that a non-whitespace margin won't get stripped:
use stripmargin::StripMargin; assert_eq!( "Hello * world!".strip_margin_with('*'), "Hello * world!", );
Provided methods
pub fn strip_margin(&self) -> String
[src]
Shorthand for strip_margin_with('|')
.
For every line in this string, strip a leading prefix consisting of blanks or control characters,
followed by '|'
from the line.
Examples
use stripmargin::StripMargin; assert_eq!( r#"Hello, | world! |"# .strip_margin(), "Hello,\n world!\n", );
Please note that a non-whitespace margin won't get stripped:
use stripmargin::StripMargin; assert_eq!( "Hello | world!".strip_margin(), "Hello | world!", );