fcf.ltrim() function
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
- Source string
- An array of characters to delete, or a single character string. If the array element is false, characters with code <= 32 are removed.
Result
- 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/"