Topic: remove leading dashes

Hi, I have a string with some number of dashes and spaces at the front of it, I want everything left of the last space gone. ltrim will get rid of spaces, but im not sure what to do here.

String example foo = "--- - mystuff"


Re: remove leading dashes

assuming that the string itself doesn't contain
1) spaces
2) dashes

m@my_clean_string = "--- - mystuff".gsub(/\s-/,")

Re: remove leading dashes

And if it does have embedded dashes, then

my_strings = ['-- - stuff', '   - - stuff - other stuff', ' --- more - stuff']

my_strings.each do |s|
   puts s.sub(/^[\s\-]+/, '')

will do the job...