Here you can find the source of replace(char[][] arrays, char character, char[][] replacements)
public static char[][] replace(char[][] arrays, char character, char[][] replacements)
//package com.java2s; /**/* w ww . j av a 2 s . c om*/ * Aptana Studio * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions). * Please see the license.html included with this distribution for details. * Any modifications to this file must keep this entire header intact. */ import java.util.ArrayList; import java.util.List; public class Main { public static char[][] replace(char[][] arrays, char character, char[][] replacements) { List<char[]> list = new ArrayList<char[]>(); for (char[] array : arrays) { String string = String.valueOf(array); if (string.indexOf(character) >= 0) { for (char[] replacement : replacements) { list.add(string.replaceAll(String.valueOf(character), String.valueOf(replacement)) .toCharArray()); } } else { list.add(array); } } return list.toArray(new char[list.size()][]); } }