Skip to content

v2.8.0 - Wasm: String trim & pad methods

Choose a tag to compare

@gmpassos gmpassos released this 18 Jul 08:25
· 139 commits to master since this release
d2b2a14

Wasm: String trim & pad methods

The on-the-fly WebAssembly compiler now supports the String trim/pad methods over its [len][utf8] layout:

  • trim() / trimLeft() / trimRight() — strip ASCII whitespace (space, \t..\r)
  • padLeft(width, [pad]) / padRight(width, [pad]) — single-byte pad (default space); a width not exceeding the length is a plain copy

These join the slice/search methods (substring, codeUnitAt, startsWith/endsWith, indexOf, contains) from 2.7.0. Byte-indexed, so exact for ASCII text.

Still to come: split, replaceAll / replaceFirst, index [], and compareTo (which also needs String.compareTo in the interpreter core first).

Full changelog: https://github.com/ApolloVM/apollovm_dart/blob/v2.8.0/CHANGELOG.md