我们是否有任何方法在mel中检查包含在另一个String中的字符串与否。 例如: 我有像“mel”的字符串。 我有另一个字符串,如“melcode”。 我们是否知道如何检查字符串“mel”在字符串“melcode”中可用。
答案 0 :(得分:4)
num indexOf(str inputString1,str inputString2)
如果返回值为-1,则inputString1不包含inputString2
答案 1 :(得分:0)
正如Is there any possible way to filter movelets using mel from another movlet?
中所述嗨Jaya Sankar,你可以使用indexOf,如果第一个输入String不包含第二个输入String,则返回-1。还有startsWith和endsWith作为方法。