remove space from string javascript
str.replace(/\s+/g, '')const removeSpaces = str => str.replace(/\s/g, '');
// Example
removeSpaces('hel lo wor ld'); // 'helloworld'var str = " Some text ";
str.trim();
// str = "Some text"var str = " Hello World! ";
alert(str.trim());str = str.trim();var puzzle1=myTrim($("#puzzleinput").val());
function myTrim(x) {
return x.replace(/^\s+|\s+$/gm,'');
}
Also in JavaScript:
- javascript regex extract url from string
- trim first character in javascript
- javascript destructing
- js get element by X Y
- react native image not working ios 14
- jquery droppable allow what can be dropped
- How to remove object from array of objects using JavaScript geeksforgeeks
- how to bind a json output result to any new model
- call node.js file electron
- javascript urlsearchparams to object
- riverSizes javascript
- ajouter un lien href dans du javascript
- javascript cast bool to int
- get syntethicbaseevent and parameter in react
- js use await in synchronous method
- nativescript absolutelayout bottom
- total array with function
- how to put firebase config in a sperate file react native
- if javascript
- js filter array
- javascript newline in alert box
- react native set default ios simulator
- Encoding and Decoding Base64 Strings in Node.js
- stockoveslow javascript