【问题标题】:Do we have any methods in mel to check string contained in some another String or not我们在 mel 中是否有任何方法来检查另一个字符串中是否包含字符串
【发布时间】:2017-02-06 04:51:21
【问题描述】:

我们在 mel 中是否有任何方法来检查是否包含在另一个字符串中的字符串。 例如: 我有像“mel”这样的字符串。 我有另一个字符串,例如“melcode”。 我们知道如何检查字符串“melcode”中的字符串“mel”是否可用。

【问题讨论】:

    标签: movilizer


    【解决方案1】:

    num indexOf(str inputString1, str inputString2)

    如果返回值为 -1 则 inputString1 不包含 inputString2

    【讨论】:

    • 好的,谢谢。但它适用于区分大小写。我们是否还有其他方法可以处理不区分大小写的字母。
    • 否,但您可以尝试打开可能让您找到的文档:str toLowerCase(str inputString) 可用于 2.4 及更高版本的客户端
    【解决方案2】:

    Is there any possible way to filter movelets using mel from another movlet?中所述

    嗨 Jaya Sankar,如果第一个输入字符串不包含第二个输入字符串,您可以使用 indexOf,它返回 -1。还有startsWith和endsWith作为方法。

    【讨论】:

      猜你喜欢
      • 2011-03-18
      • 2013-03-13
      • 1970-01-01
      • 2014-04-14
      • 2021-05-06
      • 1970-01-01
      • 2020-07-19
      • 1970-01-01
      • 2014-07-24
      相关资源
      最近更新 更多