remove Leading Spaces with regex - Java java.lang

Java examples for java.lang:String Strip

Description

remove Leading Spaces with regex

Demo Code


//package com.java2s;

public class Main {
    public static String removeLeadingSpaces(String in) {
        return in.replaceAll("^[\\s]+", "");
    }/*  w  ww. jav a  2 s  . co m*/
}

Related Tutorials