c# - Textbox, search without accents (ignore accents) -
In my Windows Phone app, there is a ListBox (populated from a JSON) and a textbox that searches for items in the list box.
This code works fine, but I need to be able to find "lapis" and find "lapis". Therefore, I need to ignore the tone on my search.
How to do this?
Private zeros txtSearch_TextChanged (Object Sender, TextChangedEventArgs e) {if (Items! = Null) {it.list 1. Item Source = Item Where (w = & gt; w.descricao.ToUpper (). (SearchTextBox.Text.ToUpper ())); }} Private Zero WatermarkTB_GotFocus (Object Sender, RoutedEventArgs E) {If (SearchTextBox.Text == "Pesquisar Produto ...") {SearchTextBox.Text = ""; Solid Caller Brush Brush 1 = New Solid Collar Brush (); Brush 1 Color = color SearchTextBox.Foreground = Brush 1; }}
change
w.descricao ToUpper (). In this (SearchTextBox.Text.ToUpper ())
To
CultureInfo.CurrentCulture.CompareInfo.IndexOf (w.descricao, SearchTextBox. unknown The meaning of non-space
indicates that string comparison characters should be ignored, such as diacritics
Comments
Post a Comment