outerspace 0.2.1

Methods for prefixing and suffixing the non-whitespace characters in a string.
Documentation

outerspace-rs

Crates.io version Crates.io downloads docs.rs docs

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");