Created
May 24, 2017 03:00
-
-
Save qwersk/bd453160515275973e7b3d80c3e63ce7 to your computer and use it in GitHub Desktop.
TRIM CHAR IN STRING #JS #JAVASCRIPT
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
var x = '|f|oo||'; | |
var y = x.replace(/^\|+|\|+$/g, ''); | |
document.write(x + '<br />' + y); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment