locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
11 lines (10 loc) • 390 B
JavaScript
export function trim_start(str) {
// discuss at: https://locutus.io/rust/trim_start/
// parity verified: Rust 1.85
// original by: Kevin van Zonneveld (https://kvz.io)
// example 1: trim_start(' hello ')
// returns 1: 'hello '
// example 2: trim_start('\n\t hello')
// returns 2: 'hello'
return String(str).trimStart();
}