[英]Combining uppercase and lowercase search option not working in angular
在我的應用程序中,我正在嘗試搜索組合詞,例如 Solar -> S is caps and others are small letters。 在這種情況下,我的搜索過濾器選項不起作用。 僅適用於小寫字母和大寫字母。 像ABCS
和abcd
。 如何為搜索選項做大寫和小寫。
過濾器.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())
);
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.