Function voca_rs::manipulate::finish[][src]

pub fn finish(subject: &str, suffix: &str) -> String
Expand description

Adds the suffix to the end of the string unless it already exists in the subject.

Arguments

  • subject - The string to extend.
  • suffix - The ending string.

Example

use voca_rs::*;
manipulate::finish("foo bar", "bar");
// => "foo bar"
manipulate::finish("fóo bąr", " ço¨oł");
// => "fóo bąr ço¨oł"
use voca_rs::Voca;
"foo bar"._finish(" cool");
// => "foo bar cool"