Here you can find the source of containsOnlyPrintableAscii(String s)
public static boolean containsOnlyPrintableAscii(String s)
//package com.java2s; import android.text.TextUtils; public class Main { public static boolean containsOnlyPrintableAscii(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) j = s.offsetByCodePoints(j, 1); else return false; }//from w w w . j av a2 s . c o m } return true; } }