Skip to content

Instantly share code, notes, and snippets.

@drulabs
Created August 7, 2018 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drulabs/835ee8799d301591f1aea9ab739c88e3 to your computer and use it in GitHub Desktop.
Save drulabs/835ee8799d301591f1aea9ab739c88e3 to your computer and use it in GitHub Desktop.
fun main (args: Array<String>) {
val x = arrayListOf("A.B", "B.C", "C.D", "D.E", "E.F")
println(x.map { stringStirrer(it) })
// above line prints [Axx, Bxx, Cxx, Dxx, Exx]
}
fun stringStirrer(param: String): String {
var changes = param.substringBefore(".")
changes += "xx"
return changes
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment