概述
startsWith()
函数判断一个字符串是否以指定字符开头,判断为真时返回1
,否则返回0
。
语法
startsWith(str, start_str)
参数 | 类型 | 描述 |
---|---|---|
str |
String | 要检查的字符串 |
start_str |
String | 预期的开头子字符串 |
返回值:Boolean
结果示例
return startsWith("ultipa.com", "Ultipa")
结果:0
使用示例
查找URL以“https://”开头的网页。
find().nodes({startsWith(@webpage.url, "https://")}) as n
return n{*}