用javascript中的stripos函数,如:
function stripos (f_haystack, f_needle, f_offset) {
var haystack = (f_haystack + '').toLowerCase();
var needle = (f_needle + '').toLowerCase();
var index = 0;
if ((index = haystack.indexOf(needle, f_offset)) !== -1) {
return index;
}
return false;
}
我将如何使用/重新编码此函数以匹配特殊字符?
仿佛:
var haystack = 'Le créme';
var needle = 'reme';
// ^ these two should match (anything other than false)