con*_*gus 1 string case-insensitive nim-lang
我想检查一个文件是否具有特定的扩展名,我可以使用filename.endsWith(".ext"). 但我也想对阵.EXT。我怎样才能做到这一点?
filename.endsWith(".ext")
.EXT
PMu*_*nch 6
最简单的可能是filename.toLowerAscii.endsWith(".ext"). 但是,您应该考虑使用splitFile来获取扩展名,然后将其与".ext"将其转为小写后进行比较。
filename.toLowerAscii.endsWith(".ext")
splitFile
".ext"
归档时间:
4 年,5 月 前
查看次数:
568 次
最近记录: