safePackageString

fun FqName.safePackageString(dotPrefix: Boolean = false, dotSuffix: Boolean = true): String

See also


fun String.safePackageString(isRoot: Boolean = isEmpty(), dotPrefix: Boolean = false, dotSuffix: Boolean = true): String

This function should only be used for package names. If the FqName is the root (no package at all), then this function returns an empty string whereas toString() would return "". For a more convenient string concatenation the returned result can be prefixed and suffixed with an additional dot. The root package never will use a prefix or suffix.