Created
December 14, 2018 23:44
-
-
Save bjpeterdelacruz/75ad1ffdba9b6fd2a6b918cbcb7f305b to your computer and use it in GitHub Desktop.
How to remove ampersands and other encoded characters using JavaScript
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
var input = "A%20&%20B%20Company"; | |
var output = $('<textarea/>').html(unescape(input).trim()).text(); | |
// output = "A & B Company" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment