slice_j

Function slice_j 

Source
pub fn slice_j(s: &JsString, start: i64, end: Option<i64>) -> Result<JsString>
Expand description

JavaScript-like slice(start, end) using UTF-16 code-unit indices.

Negative indices are relative to the end of the string. Indices are clamped into [0, len]. If end is None, it defaults to len. https://tc39.es/ecma262/#sec-string.prototype.slice