UNPKG

@stdlib/string

Version:

String manipulation functions.

30 lines (24 loc) β€’ 627 B
{{alias}}( str, start, end ) Slices a string based on Unicode code point indices. Parameters ---------- str: string Input string. start: integer The `ith` Unicode code point to start a slice (inclusive). end: integer The `jth` Unicode code point to end a slice (exclusive). Returns ------- out: string Output string. Examples -------- > var out = {{alias}}( 'Hello πŸ‘‹ World', 1, 3 ) 'el' > out = {{alias}}( 'πŸ‘‹πŸ‘‹πŸ‘‹', 1, 2 ) 'πŸ‘‹' > out = {{alias}}( 'ε…­δΉ¦/ε…­ζ›Έ', 1, 14 ) 'δΉ¦/ε…­ζ›Έ' See Also --------