Function outerspace::suffix_non_whitespace[][src]

pub fn suffix_non_whitespace(s: &str, suffix: &str) -> String
Expand description

Insert a suffix into the string after the last non-whitespace character.

Returns a heap-allocated String.

Example

let suffixed = outerspace::suffix_non_whitespace("\n\nHello hello\n\n", "!");
assert_eq!(suffixed, "\n\nHello hello!\n\n");