📅  最后修改于: 2022-03-11 15:04:49.206000             🧑  作者: Mango
# Ruby language
str_old = "first-name last-name"
str_old.sub("-", "_") # Replace first "-" with "_"
str_old.gsub("-", "_") # Replace all "-" with "_"