



Now regarding your update of the question. If instead you just wanted to concatenate a list of strings which may or may not contain null values, you may also be interested in something like the following: listOfNotNull(foo, bar).joinToString(" ") If it is ok if null is printed, I just keep it as is, i.e. If I need a default value, I go with foo ?: "". Counterquestions: what do you want to append instead? and what is your preference?
