isTitleCase function

bool isTitleCase(
  1. String str
)

Returns true if str is in Title Case (e.g. Foo Bar Baz).

Every space-separated word must start with an uppercase letter and continue in lowercase, so Foo BAR is rejected.

Implementation

bool isTitleCase(String str) => titleCaseReg.hasMatch(str);