trimStart

Removes whitespace from the left end of the str.

Usage Scenarios

  • Data Cleaning: In data processing, clean strings by removing leading whitespace.
  • Input Validation: Validate user input by removing unnecessary whitespace.

Example

import { trimStart } from 'funtool/string'

trimStart('  hello') // => 'hello' ✅
trimStart(123) // => '123' ✅

Signature

function trimStart(str: string): string

Parameters

  • str ( string ): The input string.

Returns

  • ( string ): A new string with leading whitespace removed.