我有函数比较用户输入与xml文件中的字符串,但如果有空间或拼写错误它的返回false我希望它返回true,如果差异是一个字符比较字符串,并返回true如果有小拼写错误
//xml file like this
<xmlString>HELLO</xmlString>
<result>somthing</result>
和脚本文件中像这样
var userInput="Jello";
if (userInput.toUpperCase().indexOf(xmlString) >= 0){ //this should return true and execute
return $(result).text();
}
我该怎么办呢?有没有功能,我可以使用它从jQuery或任何其他框架?
有一个美好的一天:)
什么是小错误?六分之一? –
@NinaScholz是的,你可以这么说 –