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

//ERDDAP/com.cohort.util/ScriptString2/modifyToBeVariableNameSafe

modifyToBeVariableNameSafe

[JVM]
open fun modifyToBeVariableNameSafe(s: String): String

This is like modifyToBeFileNameSafe, but restricts the name to:

  • first character must be (iso8859Letter|_).
  • subsequent characters must be (iso8859Letter|_|0-9).

Note that Java allows Unicode characters, but this does not. See also the safer encodeMatlabNameSafe(String s). Note, this does not check for names that are too long (many system have an 80 or 255 char limit).

Return

a safe variable name (but perhaps two s's lead to the same result)

Parameters

JVM

s