xxxxxxxxxx
string_with_underscore = "hello_world"
string_with_space = string_with_underscore.replace("_", " ")
print(string_with_space)
xxxxxxxxxx
var string = "my name";
string = string.replace(/ /g,"_"); //returns my_name
xxxxxxxxxx
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);
}
}
xxxxxxxxxx
@echo off
Setlocal enabledelayedexpansion
Set "Pattern= "
Set "Replace=_"
For %%a in (*.exe) Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
Pause&Exit