toLocalDateOrNull
Produce a LocalDate from the given strings value and pattern if possible.
Example:
"8/7/2022".toLocalDateOrNull("MM/dd/yyyy") // 2022-07-07
"Sun Aug 07 16:37:42 IRDT 2022".toLocalDateOrNull() // 2022-07-07
"7/2022".toLocalDateOrNull("MM/dd/yyyy") // null
Content copied to clipboard
Since
1.1.0
Return
A nullable LocalDate parsed from the string.