2
I use the index to check if a string contains a certain text. However, this is case sensitive and accents sensitive.
Would there be some way for example I find these records in case to enter in the search any of them following?:
- Joao
- Joao
- Joao
- john
- John
I imagine with regular expression I could manage, but I don’t quite understand how they work yet. Especially when it comes to a variable.
My code is like this:
var textoBusca = $("#campoBusca").val();
if(meuTexto.indexOf(textoBusca) != -1){
alert("Foram encontrados registros");
}