0
我正在構建一個小腳本,我需要知道某種方式的測試,如果一個路徑(例如一個字符串)超出另一個路徑(另一個字符串)。例如:如何知道Ruby是否有路徑在另一個之外?
/some/path
和/some/path/file.rb
將返回false
因爲file.rb
裏面/some/path
但/some/path
和/some/file.rb
將返回true
因爲file.rb
它的外面/some/path
。
在此先感謝!