Last active
June 12, 2017 16:55
-
-
Save jwadhwani/3ced698a6fd285fd14183bc66a2f98a7 to your computer and use it in GitHub Desktop.
REGEXP(JS): Replace one or more commas at the end of a string
This file contains hidden or 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
let s= "AA,VV,FF,".replace( /,+$/, ''); | |
console.log(s); //AA,VV,FF | |
let x = "AA,VV,FF,,".replace( /,+$/, ''); | |
console.log(x); //AA,VV,FF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment