Created
August 7, 2018 19:53
-
-
Save drulabs/835ee8799d301591f1aea9ab739c88e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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