Java tutorial
//package com.java2s; public class Main { /** * * @param val * @return */ public static String removeLeadingZeros(String val) { return val.replaceFirst("^0+(?!$)", ""); } }