Last active
February 28, 2018 07:08
-
-
Save andrewmunn/6feb280d4be6d2e467e10b631dbe7ff7 to your computer and use it in GitHub Desktop.
toSingleLineStringForDisplay in Kotlin v1
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
fun toSingleLineStringForDisplay(): String { | |
val sb = StringBuilder() | |
sb.append(street1).append(", ") | |
street2?.let { sb.append(it).append(", ") } | |
street3?.let { sb.append(it).append(", ") } | |
street4?.let { sb.append(it).append(", ") } | |
sb.append(city).append(", ") | |
.append(state).append(" ") | |
.append(postalCode) | |
return sb.toString() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment