replace whitespace with underscore javascript code example
Example 1: js replace space with underscore
var string = "my name";
string = string.replace(/ /g,"_"); //returns my_name
Example 2: replace whitespace into underscore in column names
# Replace any space in Column Names with Underscore:
dete_survey_updated.columns = dete_survey_updated.columns.str.replace(' ', '_')