string_search 函数
返回子串的一基位置;不存在时返回 0。
语法
StringTools:-Search(needle, text)Search(needle, text)string_search(needle, text)search_text(needle, text)
参数与选项
needle | 要查找的文本。 |
|---|---|
text | 文本值,通常写在引号中。 |
示例
- 查找子串
Search('ana', 'banana')返回 2。
返回子串的一基位置;不存在时返回 0。
StringTools:-Search(needle, text)Search(needle, text)string_search(needle, text)search_text(needle, text)needle | 要查找的文本。 |
|---|---|
text | 文本值,通常写在引号中。 |
Search('ana', 'banana')返回 2。