Here you can find the source of booleanArrayToString(boolean[] array)
Parameter | Description |
---|---|
array | the array |
public static String booleanArrayToString(boolean[] array)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . ja v a 2 s.co m * Creates a string representation of the given array of type boolean[]. * @param array the array * @return string representation of the given array */ public static String booleanArrayToString(boolean[] array) { StringBuffer sb = new StringBuffer(); sb.append("["); for (boolean a : array) { sb.append((a ? 1 : 0) + ", "); } if (sb.lastIndexOf(", ") != -1) sb.delete(sb.lastIndexOf(", "), sb.length()); sb.append("]"); return sb.toString(); } }