Hoppa till huvudinnehåll

//ERDDAP/com.cohort.util/ScriptString2/center

center

[JVM]
open fun center(s: String, length: Int): String

Returns a String 'length' long, with 's' centered (using spaces as the added characters) within the resulting String. If s is already longer, then there will be no change.

Return

's' centered to make the result 'length' long.

Parameters

JVM

sis the string to be centered.
lengthis desired length of the resulting string.