get_word_at_index

Function get_word_at_index 

Source
fn get_word_at_index(s: &str, idx: usize) -> Option<&str>
Expand description

Find the non-whitespace token in the supplied string s containing the visual index idx.

Returns Option::None if:

  • idx Is out of bounds.
  • idx Does not point to a character boundary.
  • The character at idx is whitespace