penislandbic Posted January 5, 2014 Share Posted January 5, 2014 I want to replace key words from an array in a user input string for all instances and case insensitive with the string "NOPE". An example array would be... var replacer = new Array("@", "$", "*", "drip", "slide", "move", "(", "\)"); Example: var userInput = "I have to slide down @ $3.00 with all (*) of the $ and moVe to another driping SLIDe"; *Magic replacement...* var output = "I have to NOPE down NOPE NOPE3.00 with all NOPENOPENOPE of the NOPE and NOPE to another NOPEing NOPE"; How would I do that? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.