[][src]Function voca_rs::index::index_of

pub fn index_of(subject: &str, search: &str, from_index: usize) -> i8

Returns the first occurrence index of search in subject or -1 if not found. Case sensitive.

Arguments

Example

use voca_rs::*;
index::index_of("morning", "n", 0);
// => 3
index::index_of("Zażółć gęślą jaźń", "gęślą", 0);
// => 7
index::index_of("evening", "o", 0);
// => -1
use voca_rs::Voca;
"morning"._index_of("n", 0);
// => 3