Here you can find the source of toString(String[] args, char color1, char color2)
public static String toString(String[] args, char color1, char color2)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String toString(String[] args, char color1, char color2) { StringBuilder stringBuilder = new StringBuilder(); if (args.length > 1) { for (int iii = 0; iii < args.length - 1; iii++) { stringBuilder.append("\247"); stringBuilder.append(color1); stringBuilder.append(args[iii]); stringBuilder.append("\247"); stringBuilder.append(color2); stringBuilder.append(", "); }/*from www . java 2 s .c om*/ } stringBuilder.append("\247"); stringBuilder.append(color1); stringBuilder.append(args[args.length - 1]); return stringBuilder.toString(); } public static String toString(List<String> args, char color1, char color2) { return toString(args.toArray(new String[args.size()]), color1, color2); } }