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