0.2.1 • Published 2 months ago
@stdlib/string-base-reverse-grapheme-clusters v0.2.1
reverseGraphemeClusters
Reverse the grapheme clusters (i.e., user-perceived characters) of a string.
Installation
npm install @stdlib/string-base-reverse-grapheme-clusters
Usage
var reverseGraphemeClusters = require( '@stdlib/string-base-reverse-grapheme-clusters' );
reverseGraphemeClusters( str )
Reverses the grapheme clusters (i.e., user-perceived characters) of a string.
var out = reverseGraphemeClusters( 'last man standing' );
// returns 'gnidnats nam tsal'
out = reverseGraphemeClusters( 'Hidden Treasures' );
// returns 'serusaerT neddiH'
out = reverseGraphemeClusters( 'foo bar' );
// returns 'rab oof'
Examples
var reverseGraphemeClusters = require( '@stdlib/string-base-reverse-grapheme-clusters' );
var str = reverseGraphemeClusters( 'presidential election' );
// returns 'noitcele laitnediserp'
str = reverseGraphemeClusters( 'JavaScript' );
// returns 'tpircSavaJ'
str = reverseGraphemeClusters( 'The Last of the Mohicans' );
// returns 'snacihoM eht fo tsaL ehT'
str = reverseGraphemeClusters( '🐶🐮🐷🐰🐸' );
// returns '🐸🐰🐷🐮🐶'
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.