Programming language: Ruby 1.9
Problem String: C:/Test/blah.txt to C:/Test/
C:/Test/blah.txt
C:/Test/
I know it\'s an easy question, but Google and the R
Use the Ruby File.dirname method.
File.dirname("C:/Test/blah.txt") # => "C:/Test"