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]+", "");
    }//from   ww w  .  j a  va2  s  .  c  o m
}

Related Tutorials