parts property

List<String> get parts

Split string into parts according to their case.

  1. All result parts will be lowercased.
  2. It will split by non-alphabet-and-digit characters, including whitespace and hyphen.
  3. About the case change without separator, see splitCamelCase.

Implementation

List<String> get parts => split(RegExp('[^a-zA-Z0-9]'))
    .map((part) => part.splitCamelCase)
    .expand((nestedPart) => nestedPart)
    .toList();