Delete first character "#" in String - Rails

How can I remove the first character "#" of a string?

Example:

"fooo#oooooo#bar" 

Expected Result:

 "fooooooooo#bar" "fooo#oooooo#bar".delete_first("#") // Exist some method like this? 
+4
source share
1 answer

sub (not gsub ) does the following:

 "fooo#oooooo#bar".sub('#', '') #=> "fooooooooo#bar" 
+20
source

Source: https://habr.com/ru/post/1481451/


All Articles