Rust's str module in TypeScript


We have 23 Rust functions so far - help us add more

Got a rainy Sunday afternoon and a taste for a porting puzzle?

  • Get inspiration from the Rust std::str docs.
  • Click "New file" in the appropriate folder on GitHub. This will fork the project to your account, directly add the file to it, and send a Pull Request to us.

We will then review it. If it's useful to the project and in line with our contributing guidelines your work will become part of Locutus and you'll be automatically credited in the authors section accordingly.

Upstream Surface Inventory 23/34 shipped • 3 next 68%

Namespace-level inventory for Rust 1.85: what we already ship, what we may still want, and what we intentionally skip or keep.

str primitive methods

Rust 1.85 · Catalog source: manual inventory https://doc.rust-lang.org/std/primitive.str.html

88% shipped
23/26 shipped 3 next 8 explicit non-goals
str
Shipped (23)

Next

Remaining string helpers are useful plain-value portability targets unless they depend on iterators or byte semantics.

  • is_ascii
  • repeat
  • split_ascii_whitespace
Explicit non-goals (8)
  • bytes Skip Byte iterators do not fit Locutus' current plain-value model.
  • char_indices Skip Iterator-returning APIs do not fit Locutus' plain-value model.
  • chars Skip Iterator-returning APIs do not fit Locutus' plain-value model.
  • matches Skip Iterator-returning APIs do not fit Locutus' plain-value model.
  • parse Skip Generic trait-driven parsing does not map cleanly to JS plain values.
  • rmatch_indices Skip Iterator-returning APIs do not fit Locutus' plain-value model.
  • rmatches Skip Iterator-returning APIs do not fit Locutus' plain-value model.
  • trim_matches Skip Pattern-driven trimming does not map cleanly to one stable plain-value contract.

« More Rust functions