Android String Length Check isStringWithLen(Object obj, int len)

Here you can find the source of isStringWithLen(Object obj, int len)

Description

is String With Len

Declaration

public static final boolean isStringWithLen(Object obj, int len) 

Method Source Code

//package com.java2s;

public class Main {

    public static final boolean isStringWithLen(String str, int len) {
        if (str == null) {
            return false;
        }//from   w  ww .  j ava2 s .  c o  m
        if (str.trim().length() < len) {
            return false;
        }
        return true;
    }

    public static final boolean isStringWithLen(Object obj, int len) {
        if (obj == null) {
            return false;
        }
        if (obj.toString().trim().length() < len) {
            return false;
        }
        return true;
    }
}

Related

  1. checkMinLength(final String x, final int min)
  2. isStringWithLen(String str, int len)
  3. strlen(String str, String charset)
  4. strlen(String str, String charset)
  5. strLength(String str)