sanitizeIdentifier

fun sanitizeIdentifier(rawName: String?, fallback: String): String(source)

Sanitises an arbitrary identifier so that it is safe to use as a Kotlin name.

Return

valid Kotlin identifier matching the supplied intent.

Parameters

rawName

original identifier or null.

fallback

fallback value used when rawName cannot be salvaged.