跳到主內容

//ERDDAP/com.cohort.util/ScriptString2/replaceAll

replaceAll

[JVM]
open fun replaceAll(s: String, oldS: String, newS: String): String

Returns a string where all occurences of oldS have been replaced with newS. If oldS occurs inside newS, it won't be replaced recursively (obviously).

Return

a modified version of s, with newS in place of all the olds.

Parameters

JVM

sthe main string
oldSthe string to be searched for
newSthe string to replace oldS

Throws

RuntimeExceptionif s is null.

[JVM]
open fun replaceAll(s: String, oldCh: Char, newCh: Char): String

Returns a string where all occurences of oldCh have been replaced with newCh. This doesn't throw exceptions if bad values.