I want to convert an long array values to a specific format of string.
for e.g. longArray = {0,1,2,3} to be converted as string 0.1.2.3
I can do Arrays.toString(longArray) which will return [0, 1, 2, 3].
Now this string [0,1,2,3] has to be converted into 0.1.2.3
I have used this code which works but would like to see if this code can be improved
String convertedString = Arrays.toString(longArray).replaceAll(",",".").replaceAll("[\\[,\\],\\s]", "");
I have to mention that i am on Java 7 so can't use any Java 8 features like streams Best Regards,
Saurav