📜  如何在java代码示例中打印没有大括号的矩阵

📅  最后修改于: 2022-03-11 14:52:19.704000             🧑  作者: Mango

代码示例2
for ( int i = 0; i < rows; i++) { //for each row
  String row = Arrays.toString(matrix[i])
    .replace(",", "")  //remove the commas
    .replace("[", "")  //remove the left bracket
    .replace("]", "")  //remove the right bracket
    .trim();           //remove trailing spaces from partially initialized arrays
  System.out.println(row);
}