`toString()` with a Delegate Parameter

Learn how to use toString() with a delegate parameter.

toString()

Up to this point in the course, we have defined many toString() functions to represent objects as strings. Those toString() definitions all returned a string without taking any parameters. As noted by the comment lines below, structs and classes tke advantage of toString() functions of their respective members by simply passing those members to format():

Get hands-on with 1400+ tech skills courses.