UNPKG

@stdlib/string

Version:

String manipulation functions.

31 lines (23 loc) 507 B
{{alias}}( str, n ) Removes the last `n` grapheme clusters (i.e., user-perceived characters) of a string. Parameters ---------- str: string Input string. n: integer Number of grapheme clusters to remove. Returns ------- out: string Output string. Examples -------- > var out = {{alias}}( 'beep', 1 ) 'bee' > out = {{alias}}( 'Boop', 1 ) 'Boo' > out = {{alias}}( 'foo bar', 5 ) 'fo' See Also --------