Garden 🌻

String::trim_left

Remove whitespace at the beginning of this string.

" foo ".trim_left() //-> "foo "
Source Codepublic method trim_left(this: String): String {
  let i = 0
  while i < this.len() {
    let char = this.substring(i, i + 1)
    if char != " " {
      break
    }

    i += 1
  }

  this.substring(i, this.len())
}