count 函数

语法

  • float count(inputString, matchString)

参数

  1. inputString—string
  2. matchString—string

返回

matchString 在 inputString 中的匹配项数。

描述

count 函数用于返回 matchString 在 inputString 中的匹配项数。

相关内容

示例

count("cityengine", "e")
# result = 2
count("cityengine rocks my world; cityengine should rock yours too", "cityengine")
# result = 2