×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Davide Davide
Added: Mar 3, 2022 2:05 PM
Views: 412
Tags: java tostring
  1. /**
  2.      * Convert the given object to string with each line indented by 4 spaces (except the first line).
  3.      */
  4.     private String toIndentedString(java.lang.Object o) {
  5.         if (o == null) {
  6.             return "null";
  7.         }
  8.         return o.toString().replace("\n", "\n    ");
  9.     }