prettyString
fun <T> TreeNode<T>.prettyString(connectors: TreeConnectors = TreeConnectors.Default, render: (value: T, depth: Int, isLast: Boolean) -> String = { value, _, _ -> "$value" }): String(source)
Renders this subtree as a multi-line string, one node per line, with branch connectors.
Calling this with all defaults produces output byte-identical to the no-arg member TreeNode.prettyString. Customise the drawing with connectors (e.g. TreeConnectors.Ascii) and the per-node text with render.
Return
the rendered tree, each line terminated by \n.
Parameters
connectors
the glyph set used to draw the branches. Defaults to TreeConnectors.Default.
render
produces the text for each node from its value, its depth (distance from this receiver, which is 0) and isLast (whether the node is its parent's last child; the root is considered true). Defaults to the value's string form ("$value"), which renders a null value as "null" to match the no-arg member.