[][src]Function voca_rs::manipulate::splice

pub fn splice(
    subject: &str,
    start: isize,
    delete_count: usize,
    to_add: &str
) -> String

Changes subject by deleting delete_count of characters starting at position start. Places a new string to_add instead of deleted characters.

Arguments

Example

use voca_rs::*;
manipulate::splice("new year", 0, 4, "");
// => "year"
manipulate::splice("to jest błąd", 0, 7, "mój");
// => "mój błąd"
manipulate::splice("Die Schildkröte fliegt.", -7, 0, "und Kröte ");
// => "Die Schildkröte und Kröte fliegt."
manipulate::splice("Привет", 6, 0, ", Ёлка!");
// => "Привет, Ёлка!"
use voca_rs::Voca;
"new year"._splice(0, 4, "");
// => "year"