Answers for "online text replace spaces with underscores"

PHP
4

php replace space with underscore

$str = str_replace(' ', '_', $str);
Posted by: Guest on July-14-2020
4

javascript replace space by underscore

// replaces space with '_'
str = str.replace(/ /g, "_");
// or
str = str.split(' ').join('_');
Posted by: Guest on May-11-2021

Code answers related to "online text replace spaces with underscores"

Browse Popular Code Answers by Language