removeFirstGraphemeCluster
Remove the first
n
grapheme clusters (i.e., user-perceived characters) of a string.
Usage
var removeFirstGraphemeCluster = require( '@stdlib/string/base/remove-first-grapheme-cluster' );
removeFirstGraphemeCluster( str, n )
Removes the first n
grapheme clusters (i.e., user-perceived characters) of a string.
var out = removeFirstGraphemeCluster( 'last man standing', 1 );
// returns 'ast man standing'
out = removeFirstGraphemeCluster( 'Hidden Treasures', 1 );
// returns 'idden Treasures'
out = removeFirstGraphemeCluster( 'foo bar', 5 );
// returns 'ar'
out = removeFirstGraphemeCluster( 'foo bar', 10 );
// returns ''
Examples
var removeFirstGraphemeCluster = require( '@stdlib/string/base/remove-first-grapheme-cluster' );
var str = removeFirstGraphemeCluster( 'presidential election', 1 );
// returns 'residential election'
str = removeFirstGraphemeCluster( 'JavaScript', 1 );
// returns 'avaScript'
str = removeFirstGraphemeCluster( 'The Last of the Mohicans', 5 );
// returns 'ast of the Mohicans'
str = removeFirstGraphemeCluster( '๐ถ๐ฎ๐ท๐ฐ๐ธ', 2 );
// returns '๐ท๐ฐ๐ธ'
str = removeFirstGraphemeCluster( '๐ถ๐ฎ๐ท๐ฐ๐ธ', 10 );
// returns ''