MathTop

string_search 函数

返回子串的一基位置;不存在时返回 0。

语法

  • StringTools:-Search(needle, text)
  • Search(needle, text)
  • string_search(needle, text)
  • search_text(needle, text)

参数与选项

needle要查找的文本。
text文本值,通常写在引号中。

示例

  1. 查找子串Search('ana', 'banana')返回 2。