toLocalDate

fun String.toLocalDate(format: String? = null): LocalDate?

Works off of String representations of date, without time, nor time zone. When a format is present, it'll try parsing using that format alone, & return null if it fails.

Return

LocalDate? Null means couldn't parse, else parsed LocalDate.

Parameters

this

String representation of LocalDate.

format

String representing format that should solely be used when parsing the date.