Here you can find the source of intsToString(int[] b)
Parameter | Description |
---|---|
b | int[] to print the first four indexes of. |
public static String intsToString(int[] b)
//package com.java2s; //License from project: LGPL public class Main { /**/*from w w w. j a v a 2 s . c o m*/ * Prints a int[] as a string separated by ".", if the string is to short * the default is "0.0.0.0" * * @param b int[] to print the first four indexes of. * @return The formatted string or default value. */ public static String intsToString(int[] b) { if (b.length < 4) { return "0.0.0.0"; } return String.format("%d.%d.%d.%d", b[0], b[1], b[2], b[3]); } }