newStr = splitGraphemes(str)
splits the string str into graphemes. A grapheme (also known as grapheme
cluster) is the Unicode term for human-perceived characters.
Split text into graphemes using the splitGraphemes function.
A grapheme (also known as grapheme clusters) is the Unicode term for human-perceived characters. Some graphemes contain multiple code units. For example, the "smiling face with sunglasses" emoji ( with code point U+1F60E) is a single grapheme but comprises two UTF16 code units "D83D" and "DE0E".
Input text, specified as a string array, character vector, or cell array of
character vectors. For string array and cell array input, each element of
str must have the same number of graphemes.
If the number of graphemes is not the same for every element of
str, then call the function in a for-loop to split the elements
of str one at a time.
Split graphemes, returned as a string array or a cell array of character vectors. If
str is a string array, then newStr is also a
string array. Otherwise, newStr is a cell array of character
vectors.
The size of newStr depends on the input:
If str is a string scalar or a character vector, then
newStr is an numGraphemes-by-1 string
array or cell array, where numGraphemes is the number of
graphemes.
If str is an M-by-1 string array or
cell array, then newStr is a
M-by-numGraphemes array.
If str is a 1-by-N string array or
cell array, then newStr is a
1-by-N-by-numGraphemes array.
For a string array or cell array of any size, the function orients the
split graphemes along the first trailing dimension with size 1.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.