@zerodep/string-trimleft
v2.0.10
Published
A utility to trim whitespace or specific values from the start of a string
Downloads
8
Readme
@zerodep/string-trimleft
A utility to remove a specific character from the start of a string. Non-string values will cause a ZeroDepError
to be thrown.
Full documentation is available at the zerodep.app page.
Examples
All @zerodep packages support both ESM and CJS.
import { stringTrimLeft } from '@zerodep/string-trimleft';
// or
const { stringTrimLeft } = require('@zerodep/string-trimleft');
Using Default Space Separator
stringTrimLeft(' some string '); // "some string "
Using Custom Separator
stringTrimLeft('xx some string xx', 'x'); // " some string xx"
Unsuccessful Response
stringTrimLeft({ not: 'a string' }); // throws ZeroDepError: Value is not a string