ucsplit static method

List<String> ucsplit(
  1. String value
)

Splits value into words on uppercase boundaries.

Str.ucsplit('fooBarBaz'); // ['foo', 'Bar', 'Baz']

Implementation

static List<String> ucsplit(String value) {
  if (value.isEmpty) return [];
  return value
      .split(RegExp(r'(?=[A-Z])'))
      .where((s) => s.isNotEmpty)
      .toList();
}