Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A JavaScript trimStart function
function trimStart(character, string) {
var startIndex = 0;
while (string[startIndex] === character) {
return string.substr(startIndex);

This comment has been minimized.

Copy link

jrpacheco commented Apr 19, 2018

Thank you by implementation! helpful a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.