代码之家  ›  专栏  ›  技术社区  ›  Dan

在TestComplete中使用“like”是可能的吗?

  •  0
  • Dan  · 技术社区  · 7 年前

    例如,我想搜索以ABC开头的标签:

    if(label == 'ABC') //but I have two other labels: 'ABC1' and 'ABC2'
    

    非常感谢。

    1 回复  |  直到 7 年前
        1
  •  0
  •   theGleep    7 年前

    使用正则表达式。

    var label = 'ABC'
    if (label.match(/abc[12]?/i)) console.log('yes')
    else console.log('no')