kotlin string get last code example Example: kotlin get last line of string paragraph.substring(paragraph.lastIndexOf("\n"))