メインコンテンツへスキップ

//ERDDAP/com.cohort.util/ScriptString2/noLongLines

noLongLines

[JVM]
open fun noLongLines(s: String, maxLength: Int, spaces: String): String

If lines in s are >=maxLength characters, this inserts "\n"+spaces at the previous non-DigitLetter + DigitLetter; or if none, this inserts "\n"+spaces at maxLength. Useful keywords for searching for this method: longer, longest, noLongerThan.

Return​

s (perhaps the same, perhaps different), but with no long lines

Parameters​

JVM

sa String with multiple lines, separated by \n's
maxLengththe maximum line length allowed
spacesthe string to be inserted after the inserted newline, e.g., "
"