Answers for "how to print a matrix without braces in java"

0

print array without brackets javascript

var numbers = [4,3,2,1];
console.log(numbers.join(' '));

// 4 3 2 1
Posted by: Guest on December-11-2020
0

how to print a matrix without braces in java

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);
}
Posted by: Guest on January-22-2021

Code answers related to "how to print a matrix without braces in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language