Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js replace space with underscore

var string = "my name";
string = string.replace(/ /g,"_"); //returns my_name
Comment

javascript replace space by underscore

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

replace space with underscore in c#

using System;
class Demo {
   static void Main() {
      String str, str2;
      str ="Hello World !";
      Console.WriteLine("String: "+str);
      str2 = str.Replace(" ", "-");
      Console.WriteLine("String (After replacing): "+str2);
   }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: ts-node: command not found 
Javascript :: update all packages in package.json 
Javascript :: bootstrap datepicker js cdn 
Javascript :: jquery clear file input 
Javascript :: jquery if id exists 
Javascript :: react bootstrap do you need to import 
Javascript :: javascript replace all space 
Javascript :: jquery latest version cdn 
Javascript :: java script converting text to slug 
Javascript :: dconf-editor install 
Javascript :: ruby read json file 
Javascript :: tolowercase jquery 
Javascript :: add 24 hours to string date javascript 
Javascript :: dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.66.dylib Referenced from: /usr/local/bin/node Reason: image not found 
Javascript :: javascript end of day 
Javascript :: javascript get element by class 
Javascript :: model show in jquery 
Javascript :: javascript difference between two dates 
Javascript :: dinosaur game 
Javascript :: javascript knowing when space is pressed 
Javascript :: javascript clear div 
Javascript :: javascript style background color 
Javascript :: first letter capital in jquery 
Javascript :: 1 line uuid 
Javascript :: javascript get string between two parentheses 
Javascript :: remove and add active class with jquery 
Javascript :: react install 
Javascript :: integer to roman javascript 
Javascript :: Could not resolve dependency: peer react@"^18.2.0" from react-dom@18.2.0 
Javascript :: cypress backspace 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =