In a url I have to encode the operators present in the dropdown combo box
string itemCode = (IsURLEncodingNeeded && URLEncodingType == ViewModel.URLEncodingType.HexEscaped) ? Uri.HexEscape((SelectedItem.ItemCode).ToCharArray()[0]): SelectedItem.ItemCode;
Parameters.Add(RequestObject.FieldedQueryStrings, (this.Key + ":" + itemCode));
In the above code I'm trying to encode the operators if its present in the dropdown combobox selected item "Uri.HexEscape((SelectedItem.ItemCode).ToCharArray()[0])"
Issue is for example if the selected item contains value as "A+" it is encoded as %41, in this case entire value gets encoded. but I need to encode the operators alone.that is I need to encode only "+" not "A+" which results as "%2B" correctly.
the combobox items will be received from backend it may contain any values like "AA+","B+","text"etc.. I just wanto seperate the operator present in the selecteditem value and encode it alone. how can it be done?
string itemCode = (IsURLEncodingNeeded && URLEncodingType == ViewModel.URLEncodingType.HexEscaped) ? Uri.HexEscape((SelectedItem.ItemCode).ToCharArray()[0]): SelectedItem.ItemCode;
Parameters.Add(RequestObject.FieldedQueryStrings, (this.Key + ":" + itemCode));
In the above code I'm trying to encode the operators if its present in the dropdown combobox selected item "Uri.HexEscape((SelectedItem.ItemCode).ToCharArray()[0])"
Issue is for example if the selected item contains value as "A+" it is encoded as %41, in this case entire value gets encoded. but I need to encode the operators alone.that is I need to encode only "+" not "A+" which results as "%2B" correctly.
the combobox items will be received from backend it may contain any values like "AA+","B+","text"etc.. I just wanto seperate the operator present in the selecteditem value and encode it alone. how can it be done?