stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

Add charset based variants for trimming, rename from left/right to start/end

Open ollien opened this issue 1 year ago • 2 comments
trafficstars

Fixes https://github.com/gleam-lang/stdlib/issues/587

The primary intent of this PR is to add trim_with, trim_start_with and trim_end_with to the string module, which will trim the specified chars from both ends of a string, the start of a string, or the end of the string, respectively.

Given this change from left/right to start/end (to be more clear about RTL behavior), I renamed the existing trim_left/trim_end to trim_start and trim_end, and deprecated the old ones. Do let me know if this was an over-reach on my part!

The names here are certainly changeable here, I just picked ones that made sense to me :)

ollien avatar Oct 06 '24 18:10 ollien