Here you can find the source of doubleArrayToString(double[] array)
Parameter | Description |
---|---|
array | the array |
public static String doubleArrayToString(double[] array)
//package com.java2s; //License from project: Open Source License public class Main { /**// w ww . j a v a 2s. c o m * Creates a string representation of the given array of type double[] (this representation * can be parsed using the method parseDoubleArray). * @param array the array * @return string representation of the given array */ public static String doubleArrayToString(double[] array) { StringBuilder sb = new StringBuilder(); sb.append("["); for (double a : array) { sb.append(a).append(", "); } if (sb.lastIndexOf(", ") != -1) sb.delete(sb.lastIndexOf(", "), sb.length()); sb.append("]"); return sb.toString(); } }