मुख्य सामग्री पर जाएं

//ERDDAP/com.cohort.util/ScriptString2/noLongerThan

noLongerThan

[JVM]
open fun noLongerThan(s: String, max: Int): String

This returns a string no more than max characters long, throwing away the excess. If you want to keep the whole string and just insert newlines periodically, use noLongLines() instead.

Return

s (if it is short) or the first max characters of s. If s==null, this returns "".

Parameters

JVM

s
max