Here you can find the source of underscoreToSpace(String value)
public static String underscoreToSpace(String value)
//package com.java2s; //License from project: Apache License public class Main { public static String underscoreToSpace(String value) { if (value == null) { throw new IllegalArgumentException("Passed value can not be null."); }/*from w ww . j av a 2 s . com*/ return underscoresToSpaces(value, false); } public static String underscoresToSpaces(String value) { if (value == null) { throw new IllegalArgumentException("Passed value can not be null."); } 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("_", " "); } } }