3 unstable releases
0.2.1 | Oct 23, 2021 |
---|---|
0.2.0 | Oct 23, 2021 |
0.1.0 | Mar 10, 2021 |
#1041 in Text processing
8KB
89 lines
outerspace-rs
This is the Rust version of the outerspace JavaScript package.
Methods for prefixing and suffixing the non-whitespace characters in a string.
Examples
let prefixed = outerspace::prefix_non_whitespace("\n\nHello hello\n\n", "> ");
assert_eq!(prefixed, "\n\n> Hello hello\n\n");
let suffixed = outerspace::suffix_non_whitespace("\n\nHello hello\n\n", "!");
assert_eq!(suffixed, "\n\nHello hello!\n\n");
let wrapped = outerspace::wrap_non_whitespace("\n\nHello hello\n\n", "**", "**");
assert_eq!(wrapped, "\n\n**Hello hello**\n\n");