wordToSentence property

String get wordToSentence

Convert lowerCamelCase word to sentence Like a = "appleBallCat" a.worldToSentence results Apple Ball Cat

Implementation

String get wordToSentence {
  if (isEmpty) {
    return this;
  } else {
    String b = split("")
        .map(
          (e) => e.contains(RegExp(r'[A-Z]')) ? "-$e" : e,
        )
        .toList()
        .join("")
        .split("-")
        .join(" ");
    return b;
  }
}