Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript replace space with minus

// replaces space with '-'
str = str.replace(/ /g, "-");
// or
str = str.split(' ').join('-');
Comment

PREVIOUS NEXT
Code Example
Javascript :: disable all element in div angular 12 
Javascript :: javascript run every 5 seconds 
Javascript :: br in react native 
Javascript :: How to get current URL with Javascript or React 
Javascript :: jquery submit form ajax 
Javascript :: prevent default window on right click menu 
Javascript :: js if not undefined 
Javascript :: check if checkbox is checked jquery 
Javascript :: path must be absolute or specify root to res.sendFile 
Javascript :: Composer could not find a composer.json file in To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section 
Javascript :: jquery button remove disabled attribute 
Javascript :: regular expression to remove empty lines after text 
Javascript :: javascript set local storage value 
Javascript :: dom ready js 
Javascript :: set value in span using javascript 
Javascript :: remove all characters from string javascript 
Javascript :: react start new app 
Javascript :: js is empty object 
Javascript :: change display javascript 
Javascript :: date add 1 hour javascript 
Javascript :: JS get random number between 
Javascript :: discord.js check if user is admin 
Javascript :: javascript sort boolean value 
Javascript :: z index style javascript 
Javascript :: js start with 
Javascript :: call a function when page loads javascript 
Javascript :: jquery set checkbox 
Javascript :: DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect. 
Javascript :: clone object in js 
Javascript :: Reset reCAPTCHA js 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =