I have a single string variable 'v1' of the form(every line is split using "\r\n"):
a, 2.0, 2.0, 3.0
b, 1.0, 3.0, 6.8
c, 4.0, 2.8, 5.4
The output should be a single string variable 'out1' of the form:
b, 1.0, 3.0, 6.8
c, 4.0, 2.8, 5.4
a, 2.0, 2.0, 3.0
I am supposed to sort the above input on the basis of the part of the string written after the last comma of every line(eg.: 6.8, 5.4 and 3.0 in the above case). This is to be done in java.
How to implement it(no need to worry about efficiency)?
Maybe you could do: