In my application, I am trying to search combining words like Solar -> S is caps and others are small letters. In this condition, my search filter option is not working. Only working for small letters and capital letters. like ABCS and abcd. How to do for search option both uppercase and lowercase.
filter.pipe.ts:
return products.filter((items) => {
return (
items.product_name.toLowerCase().includes(searchText) ||
items.product_content.toLowerCase().includes(searchText) ||
items.product_name.toUpperCase().includes(searchText) ||
items.product_content.toUpperCase().includes(searchText)
);
});
return products.filter((items) => {
return (
items.product_name.toLowerCase().includes(searchText.toLowerCase()) ||
items.product_content.toLowerCase().includes(searchText.toLowerCase())
);
});