is a string's length In Range - Android java.lang

Android examples for java.lang:String Null or Empty

Description

is a string's length In Range

Demo Code

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Pattern;

public class Main{


    public static boolean lengthInRange(String string, int begin, int end) {
        return string != null && string.length() >= begin
                && string.length() <= end;
    }// w  w  w. ja  v a2 s  .com

}

Related Tutorials