且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何测试字符串是否与Ruby中的glob相匹配?

更新时间:2023-01-14 20:40:31

是的,可以使用 fnmatch 方法:

Yes, it is possible using the fnmatch method:

File.fnmatch("foo*", "food") #=> true