মূল বিষয়বস্তু উপেক্ষা করুন

//ERDDAP/com.cohort.util/ScriptString2/isPrintable

isPrintable

[JVM]
fun isPrintable(ch: Int): Boolean

This indicates if ch is printable with System.err.println() and Graphics.drawString(); hence, it is a subset of 0..255.

  • This is used, for example, to limit characters entering CoText.
  • Currently, this accepts the ch if (ch>=32 && ch<127) || (ch>=161 && ch<=255).
  • tab(#9) is not included. It should be caught separately and dealt with (expand to spaces?). The problem is that tabs are printed with a wide box (non-character symbol) in Windows Courier font. Thus, they mess up the positioning of characters in CoText.
  • newline is not included. It should be caught separately and dealt with.
  • This requires further study into all standard fonts on all platforms to see if other characters can be accepted.

Return

true if ch is a printable character

Parameters

JVM

cha char

[JVM]
fun isPrintable(s: String): Boolean

Returns true if all of the characters in s are printable