private final static Pattern LTRIM = Pattern.compile("^\\s+"); tip. \\s+$ private String ltrim(String s) { return LTRIM.matcher(s).replaceAll(""); } ^ : 시작. \s : 공백. + : 하나 이상. 매칭되는것 없애준다. 끝.