Here you can find the source of underscoresToSpaces(String value)
public static String underscoresToSpaces(String value)
//package com.java2s; //License from project: Apache License public class Main { public static String underscoresToSpaces(String value) { if (value == null) { throw new IllegalArgumentException("Passed value can not be null."); }/*from w w w. j av a 2s .c o m*/ return underscoresToSpaces(value, true); } private static String underscoresToSpaces(String value, boolean all) { if (value == null) { throw new IllegalArgumentException("Passed value can not be null."); } if (all) { return value.replace("_", " "); } else { return value.replaceFirst("_", " "); } } }