Skip to content

Instantly share code, notes, and snippets.

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

This comment has been minimized.

Copy link

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.