Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

remove special characters from string javascript

var str = "Hello^# World/";
str.replace(/[^a-zA-Z ]/g, ""); // "Hello World"
Comment

remove special characters from string javascript

var desired = stringToReplace.replace(/[^ws]/gi, '')

//if you are using non english like arabic and other language
var outString = sourceString.replace(/[`~!@#$%^&*()_|+-=?;:'",.<>{}[]/]/gi, '');
Comment

Remove special char 4m JS and Join

function myFunction(a, b) {
  const str = a.concat(b.split("").reverse().join("")).replaceAll("%", "");
  return str[0].toUpperCase() + str.slice(1);}
Comment

PREVIOUS NEXT
Code Example
Javascript :: prompt dentro de una funcion javascript 
Javascript :: js cyclic motion based on cosine 
Javascript :: angular + An unhandled exception occurred: Transform failed with 1 error: 
Javascript :: alternative of tofixed javascript 
Javascript :: Reversing the elements in an array-like object 
Javascript :: angularjs smooth scroll css 
Javascript :: delete all items in an array 
Javascript :: select inputs without specific type js 
Javascript :: if (arr.indexOf(i) === -1) { return false; 
Javascript :: Expo Location Error: Unhandled promise rejection: Error: Not authorized to use background location services 
Javascript :: Fetch data changing on reload from array to undefined 
Javascript :: filter json array based on multiple arguments including lists 
Javascript :: angularjs Indicators and Paginator styling for PrimeNG Carousel 
Javascript :: angularjs Re-evalute expressions when page reloads via history 
Javascript :: Getting PointerEvent instead of jQuery.Event on ng-click in AngularJS 
Javascript :: Porting Promise Chaining from AngularJs to VueJs 
Javascript :: Filtering smart-table on transformed data 
Javascript :: Check if a user joins, leaves, or moves channels discord.js 
Javascript :: javascript is nodelist 
Javascript :: restrict file input with react uploady 
Javascript :: remember me option in firebase + react 
Javascript :: TypeError: (intermediate value).addBooks is not a function in js 
Javascript :: dfs javascript 
Javascript :: phaser max size of group or pool 
Javascript :: Creating Genesis Block for blockchain 
Javascript :: Self Invoking Function Tip 
Javascript :: Good Example: Focus moved to AJAX content with tabindex="-1" after a delay 
Javascript :: blob to wav javascript 
Javascript :: jquery properties 
Javascript :: pass data between router components 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =