Function voca_rs::manipulate::start

source ·
pub fn start(subject: &str, prefix: &str) -> String
Expand description

Adds the prefix to the start of the string unless it already exists in the subject.

Arguments

  • subject - The string to extend.
  • prefix - The starting string.

Example

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