time-to-botec/js/node_modules/@stdlib/string/split-grapheme-clusters
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

splitGraphemeClusters

Split a string by its grapheme cluster breaks.

Usage

var splitGraphemeClusters = require( '@stdlib/string/split-grapheme-clusters' );

splitGraphemeClusters( str )

Splits a string by its grapheme cluster breaks.

var out = splitGraphemeClusters( 'café' );
// returns [ 'c', 'a', 'f', 'é' ]

out = splitGraphemeClusters( '🍕🍕🍕' );
// returns [ '🍕', '🍕', '🍕' ]

Examples

var splitGraphemeClusters = require( '@stdlib/string/split-grapheme-clusters' );

var out = splitGraphemeClusters( 'abc' );
// returns [ 'a', 'b', 'c' ]

out = splitGraphemeClusters( 'Iñtërnâtiônàlizætiøn' );
// returns [ 'I', 'ñ', 't', 'ë', 'r', 'n', 'â', 't', 'i', 'ô', 'n', 'à', 'l', 'i', 'z', 'æ', 't', 'i', 'ø', 'n' ]

out = splitGraphemeClusters( '\uD834\uDD1E' );
// returns [ '𝄞' ]

out = splitGraphemeClusters( '! !' );
// returns [ '!', ' ', '!' ]

out = splitGraphemeClusters( '' );
// returns []