FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.ltrim() function

string fcf.ltrim(string a_str, string|false|[string|false] a_delimiter = [false])

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Removes the given characters from the beginning of a string

Arguments

string a_str
- Source string

string|false|[string|false] a_delimiter = [false]
- An array of characters to delete, or a single character string. If the array element is false, characters with code <= 32 are removed.
Result
string
- Result string

Example: Default mode

let newString = fcf.ltrim(` test string `); console.log(`"${newString}"`);

Output:

"test string "

Example: Single delimiter

let newString = fcf.ltrim(`/path/file/`, "/"); console.log(`"${newString}"`);

Output:

"path/file/"

Example: Multiple delimiter

let newString = fcf.ltrim(` / \\ path/file/`, ["/","\\", false]); console.log(`"${newString}"`);

Output:

"path/file/"