I have one text box in the User Interface where in user is asked to key in some input , which in turn i am saving in database , which finally i have to show in the dynamically populated dropdown list . since the user can type in any ways in the text box as in
- XXXXXX
-
XXXXXX
or1.XXXXXX ,2. XXXXXXX
or
XXXXXXXXX, XXXXXXXX
but i want to just get the value of these so that i can show just text value in my dropdown .
Can someone help in parsing this stuff.
It depends on the formats you are supposed to parse. If they are exactly the above three, then:
string.replaceAll("\\d\\.", "")str.split("\\n")str.trim()everything, just in case