All Downloads are FREE. Search and download functionalities are using the official Maven repository.

water.util.StringUtils Maven / Gradle / Ivy

There is a newer version: 3.8.2.9
Show newest version
package water.util;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * String manipulation utilities.
 */
public class StringUtils {

  /**
   * Print exception stack trace into a string.
   *
   * @param t  an exception
   * @return string containing pretty printed exception
   */
  public static String toString(Throwable t) {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    t.printStackTrace(pw);
    String stackTrace = sw.toString();
    return stackTrace;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy