addLineNumbers

fun addLineNumbers(    source: String,     pattern: String,     startingLineNumber: Int): String

Add line numbers to the given string. Start the numbering at the specified value.

Return

The string containing line numbers.

Parameters

source

The string to add line numbers to.

pattern

The pattern to use on each line. The first pattern argument is the line number (int), and the second is the String containing the line, including a terminal '\n'.

startingLineNumber

What to number the first line as.