I have an output in the console from my code like the sample given below,
... columns=20xs, viewport_supported=true, wta=false, ..., mmf=false
... columns=11xs, viewport_supported=false, wta=false, ..., mmf=true
... columns=15xs, viewport_supported=true, wta=false, ..., mmf=false
I want to re-arrange it by extracting the common string left to the ‘=’ sign and put it as the column header and its values in its column. How to start doing this in Java?
I am looking for the output like below:
columns viewport_supported wta and so on
20xs true false
11xs false false
15xs true false
I finally was able to do it like this: Split the string using split() method, create a Map dynamic array and assign key and value to the string respectively on either side of the ‘equals to sign’. Then printing the header information by parsing the map representing the first data row and then print all the data rows by iterating the objects from the Map. excerpts from my code is given below.
// given string will be split by the argument delimiter provided.
Thank you all for your help.