jetbrains.buildServer.configs.kotlin.v2018_2 / kotlin.String / toId

toId

fun String.toId(prefix: String = ""): String

Creates a string satisfying requirements for entity id in TeamCity. Can be used to generate an id from a name.

"Fast Tests".toId() //result: FastTests
"Fast Tests".toId("MainProject") //result: MainProject_FastTests

Parameters

prefix - an optional prefix to add to the id