更新时间:2023-01-14 20:40:31
是的,可以使用 fnmatch 方法:
fnmatch
Yes, it is possible using the fnmatch method:
File.fnmatch("foo*", "food") #=> true
如何测试字符串是否与Ruby中的glob相匹配?
如何找到一个字符串是否以Ruby中的另一个字符串开头?
如何检查字符串是否包含 ruby 中的特殊字符