Open juliancoleman opened 5 years ago
Because JS isn't a memory-safe language (in that memory is dynamically allocated), there are a number of functions that simply can't be added unless I made a new String class, which I won't do. The biggest question is: do I want to use generators where Rust uses iterators? Also, if I find out that this whole bytes
thing isn't going to work out like I planned it to, then that sucks, but at least I'd have learned something
from_utf8
from_utf8_unchecked
from_utf8_lossy
from_utf16
from_utf16_lossy
into_bytes
push_str
truncate
pop
retain
insert
insert_str
len
is_empty
split_off
clear
replace_range
(may not implement as String.prototype.replace exists)is_char_boundary
split_at
chars
char_indices
bytes
split_whitespaces
split_ascii_whitespaces
lines
splitLines
; may rename to lines
)encode_utf16
(? need to do some research on how this works)contains
(make this blazing fast)find
rfind
rsplit
split_terminator
rsplit_terminator
splitn
rsplitn
matches
rmatches
match_indices
rmatch_indices
trim_matches
(Similar to underscore.string/trim)trim_start_matches
(Will come much later)trim_end_matches
(Will also come much later)parse
is_ascii
eq_ignore_ascii_case
make_ascii_uppercase
(hmm..)make_ascii_lowercase
(...)replacen
JS
String
s are stored asutf-16
, so if I want them stored asutf-8
(rather, utf-8-like, since they will still be utf-16 when converted back), we could filter a string, keeping only values that lie within a certain codepoint range.https://doc.rust-lang.org/std/string/struct.String.html https://doc.rust-lang.org/std/primitive.str.html