array_tool::string

Trait SubstMarks

Source
pub trait SubstMarks {
    // Required method
    fn subst_marks(&self, marks: Vec<usize>, chr: &'static str) -> String;
}
Expand description

Substitute string character for each index given.

Required Methods§

Source

fn subst_marks(&self, marks: Vec<usize>, chr: &'static str) -> String

§Example
use array_tool::string::SubstMarks;

"asdf asdf asdf".subst_marks(vec![0,5,8], "Z");
§Output
"Zsdf ZsdZ asdf"

Implementations on Foreign Types§

Source§

impl SubstMarks for str

Source§

fn subst_marks(&self, marks: Vec<usize>, chr: &'static str) -> String

Implementors§