split_graphemes

Function split_graphemes 

Source
pub fn split_graphemes(s: &str) -> Vec<&str>
Expand description

Split the target string into a vector of graphemes str.

§Arguments

  • s - The string to split into characters.

§Returns

Returns a vector containing the characters extracted from the input string.

§Example

use rufl::string;

assert_eq!(vec!["a̐", "é", "ö̲"], string::split_graphemes("a̐éö̲"));

assert_eq!(vec!["h", "e", "l", "l", "o"], string::split_graphemes("hello"));

assert_eq!(vec!["你", "好"], string::split_graphemes("你好"));