nmResoLabel function

String nmResoLabel(
  1. String value
)

Readable label for a RESO lookup value: SingleFamilyResidence → "Single Family Residence" (values that already contain spaces pass through).

Implementation

String nmResoLabel(String value) =>
    value.contains(' ') ? value : value.replaceAllMapped(RegExp(r'(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])'), (_) => ' ');