outerspace

Crates.ioouterspace
lib.rsouterspace
version0.2.1
sourcesrc
created_at2021-03-10 16:28:11.074944
updated_at2021-10-23 11:49:16.510409
descriptionMethods for prefixing and suffixing the non-whitespace characters in a string.
homepage
repositoryhttps://github.com/stefee/outerspace-rs
max_upload_size
id366839
size7,032
stef (stefee)

documentation

README

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");
Commit count: 6

cargo fmt