Last active
January 31, 2017 22:12
-
-
Save sohnryang/821b61ba7eb1b5d4e275873c8b68d17d to your computer and use it in GitHub Desktop.
scala for the impatient - get first & last character
This file contains 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
val str = "ABCD" | |
//First character | |
println(str(0)) | |
//Last character | |
println(str takeRight 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment