标签: d phobos
我需要一个函数来测试字符串是否以某个后缀结尾。我可以使用'lastIndexOf'来执行此任务,但我想知道是否有标准的phobos功能?
答案 0 :(得分:7)
是的,确实如此。 std.algorithm.endsWith适用于字符串以及其他数组和范围。
std.algorithm.endsWith