hi is there better way to frame this code ```fun ...
# announcements
a
hi is there better way to frame this code
Copy code
fun make(rows: Int, cols: Int): String {
    val table = StringBuilder()
    for (rpos in 0..rows) {
        table.append(START_ROW)
        for (cpos in 0..cols) {
            val cell = "${START_CELL}${cpos+rpos}${END_CELL}"
            table.append(cell)
        }
        table.append(END_ROW)
    }
    return table.toString()
}
d
buildString
can be used
e
and
.joinToString()
can be used as well (if using StringBuilder/buildString on the outside, then the variant
.joinTo()
inside can avoid an extra intermediate string)
a
Thank you @Dominaezzz @ephemient