Module string

Module string 

Source
Expand description

JavaScript string manipulation, escaping, and regex helper functions.

Functions§

char_code_at
Returns the UTF-16 code unit at index, matching JS charCodeAt.
char_code_at_j
Returns the UTF-16 code unit at index, matching JS charCodeAt.
index_of
JavaScript-like indexOf(search, fromIndex) using UTF-16 code-unit indices.
index_of_j
JavaScript-like indexOf(search, fromIndex) using UTF-16 code-unit indices.
js_regex
js_string
search
JavaScript-like search(regex) using UTF-16 code-unit indices, given Rust string as input.
search_j
JavaScript-like search(regex) using UTF-16 code-unit indices.
slice
JavaScript-like slice(start, end) using UTF-16 code-unit indices.
slice_j
JavaScript-like slice(start, end) using UTF-16 code-unit indices.
substr
JavaScript-like substr(start, length) using UTF-16 code-unit indices.
substr_j
JavaScript-like substr(start, length) using UTF-16 code-unit indices.
take_char_at
Take a single “character” at index, keeping surrogate pairs together.
take_char_at_j
Take a single “character” at index, keeping surrogate pairs together.