Function cha_rs::extract

source ·
pub fn extract(
    input: &str,
    indices: &[usize]
) -> Result<Vec<char>, ExtractError>
Expand description

Extract the characters at the given indices from the input string.

Examples

use cha_rs::*;
let chars = extract("hello", &[1,5]).unwrap();
assert_eq!(chars, &['h', 'o']);