xxxxxxxxxx
for file in *; do mv "$file" $(echo $file | tr ' ' '_') ; done
xxxxxxxxxx
var string = "my name";
string = string.replace(/ /g,"_"); //returns my_name
xxxxxxxxxx
@echo off
Setlocal enabledelayedexpansion
Set "Pattern= "
Set "Replace=_"
For %%a in (*.exe) Do (
Set "File=%%~a"
Ren "%%a" "!File:%Pattern%=%Replace%!"
)
Pause&Exit
xxxxxxxxxx
string_with_underscore = "hello_world"
string_with_space = string_with_underscore.replace("_", " ")
print(string_with_space)