String filtering

I want to get the name of a subdirectory.

Alternative_Plugin_Dir = “C:/ProgramData/Google/SU_Plugins_by_Author/”
Alternative_Plugin_array = Dir[Alternative_Plugin_Dir + ""]
Alternative_Plugin_array.each do |x|
p x
p Alternative_Plugin_Dir
p x.scan(/’#{Alternative_Plugin_Dir}’\S
/) # This returns: []
end

p x[/#{Alternative_Plugin_Dir}([^])/,1]

i rather use above to

p x.split(Alternative_Plugin_Dir)[1]

resolved

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs