https://github.com/stefee/outerspace-rs
https://github.com/stefee/outerspace-rs
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stefee/outerspace-rs
- Owner: stefee
- Created: 2021-03-10T15:52:02.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-23T11:49:11.000Z (over 4 years ago)
- Last Synced: 2025-07-25T16:26:15.414Z (11 months ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# outerspace-rs
[](https://crates.io/crates/outerspace)
[](https://crates.io/crates/outerspace)
[](https://docs.rs/outerspace)
This is the Rust version of the [outerspace JavaScript package](https://www.npmjs.com/package/outerspace).
Methods for prefixing and suffixing the non-whitespace characters in a string.
# Examples
```rust
let prefixed = outerspace::prefix_non_whitespace("\n\nHello hello\n\n", "> ");
assert_eq!(prefixed, "\n\n> Hello hello\n\n");
```
```rust
let suffixed = outerspace::suffix_non_whitespace("\n\nHello hello\n\n", "!");
assert_eq!(suffixed, "\n\nHello hello!\n\n");
```
```rust
let wrapped = outerspace::wrap_non_whitespace("\n\nHello hello\n\n", "**", "**");
assert_eq!(wrapped, "\n\n**Hello hello**\n\n");
```