Java Array2List
Convert an java array initializer into a list.
Start file
double[] c = { 112.2, 102, 12, 954, 39.43, 49.4, 2224.6, 94, 123, 4929.55, 12, 98, 91.22 };
End file
List<Double> c = new ArrayList<Double>(); c.add(112.2); c.add(102d); c.add(12d); c.add(954d); c.add(39.43); c.add(49.4); c.add(2224.6); c.add(94d); c.add(123d); c.add(4929.55); c.add(12d); c.add(98d); c.add(91.22);
View Diff
1,6c1,14 < double[] c = < { < 112.2, 102, 12, 954, 39.43, < 49.4, 2224.6, 94, 123, < 4929.55, 12, 98, 91.22 < }; --- > List<Double> c = new ArrayList<Double>(); > c.add(112.2); > c.add(102d); > c.add(12d); > c.add(954d); > c.add(39.43); > c.add(49.4); > c.add(2224.6); > c.add(94d); > c.add(123d); > c.add(4929.55); > c.add(12d); > c.add(98d); > c.add(91.22);
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 86 remaining solutions by signing in and submitting your own entry
#87 basyura / @basyura - Score: 269 - 04/24/11 @ 07:49
ddddddddddddddddddddddddddddddddddList<Double> c = new ArrayList<Double>();<CR>c.add(112.2);<CR>c.add(102d);<CR>c.add(12d);<CR>c.add(954d);<CR>c.add(39.43);<CR>c.add(49.4);<CR>c.add(2224.6);<CR>c.add(94d);<CR>c.add(123d);<CR>c.add(4929.55);<CR>c.add(12d);<CR>c.add(98d);<CR>c.add(91.22);<CR>dd<NL>k<Esc>ddddgggiLi<Esc>:wq<CR>
0 comments