Here you can find the source of lengthCheck(final String str, final int minLength, final int maxLength)
Parameter | Description |
---|---|
str | string to check |
minLength | the minimum length |
maxLength | the max length |
public static boolean lengthCheck(final String str, final int minLength, final int maxLength)
//package com.java2s; public class Main { /**//from www . j a v a2 s . c om * Check the length of the string str using the minimum and maximum values provided. * * @param str string to check * @param minLength the minimum length * @param maxLength the max length * @return true if the str is between the constraints, false if it violates them. */ public static boolean lengthCheck(final String str, final int minLength, final int maxLength) { int len = str.length(); return len >= minLength && len <= maxLength; } }