如何检查字符串是否包含在 Crystal Lang 的子字符串中?
How to check if a string is contained in a substring in Crystal Lang?
我在 Crystal API 中没有看到 String#contains
方法或 String#search
方法。
有String#includes?
which checks if the search exists in the string and returns a bool or String#index
其中returns搜索的索引如果存在
我在 Crystal API 中没有看到 String#contains
方法或 String#search
方法。
有String#includes?
which checks if the search exists in the string and returns a bool or String#index
其中returns搜索的索引如果存在