Created
July 5, 2019 10:18
-
-
Save v-vashchenko/38900d740de89620084ba1f5cce8da21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const leftTrim = (string) => { | |
if (!string) return string; | |
return string.replace(/^\s+/g, ''); | |
} | |
export const rightTrim = (string) => { | |
if (!string) return string; | |
return str.replace(/\s+$/g, ''); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment