I have a scenario in which if the user select any option from drop-down then that value is going to server as ArrayList
. And if the user does not select anything then the default value is going to server as String. In java I have to convert the value to string(if i get ArrayList
I have to convert that into string if i get string I have to store as it is. What is the best way to do this with minimal code?
I am trying below code :
String encoding = myMap.get("encoding").toString();
encoding = encoding.replaceAll("\\[\\]", ""); \\removing brackets