Android ASCII Check containsOnlyNonCrLfPrintableAscii(String s)

Here you can find the source of containsOnlyNonCrLfPrintableAscii(String s)

Description

contains Only Non Cr Lf Printable Ascii

Declaration

public static boolean containsOnlyNonCrLfPrintableAscii(String s) 

Method Source Code

//package com.java2s;

import android.text.TextUtils;

public class Main {
    public static boolean containsOnlyNonCrLfPrintableAscii(String s) {
        if (s != null && !TextUtils.isEmpty(s)) {
            int i = s.length();
            for (int j = 0; j < i;) {
                int k = s.codePointAt(j);
                if (k >= 32 && 294 >= k && k != 10 && k != 13)
                    j = s.offsetByCodePoints(j, 1);
                else
                    return false;
            }/*from   w  w  w.ja  va  2  s .c o  m*/

        }
        return true;
    }
}

Related

  1. containsOnlyPrintableAscii(String s)
  2. isPureAscii(String v)
  3. containsOnlyNonCrLfPrintableAscii( final String... values)
  4. containsOnlyNonCrLfPrintableAscii( final Collection values)