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 ''
Did you find this page helpful?