Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby replace certain character

# Ruby language
str_old = "first-name last-name"
str_old.sub("-", "_") 		# Replace first "-" with "_"
str_old.gsub("-", "_") 		# Replace all "-" with "_"
 
PREVIOUS NEXT
Tagged: #ruby #replace #character
ADD COMMENT
Topic
Name
6+2 =