Crates.io | outerspace |
lib.rs | outerspace |
version | 0.2.1 |
source | src |
created_at | 2021-03-10 16:28:11.074944 |
updated_at | 2021-10-23 11:49:16.510409 |
description | Methods for prefixing and suffixing the non-whitespace characters in a string. |
homepage | |
repository | https://github.com/stefee/outerspace-rs |
max_upload_size | |
id | 366839 |
size | 7,032 |
This is the Rust version of the outerspace JavaScript package.
Methods for prefixing and suffixing the non-whitespace characters in a string.
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");