apply method

String apply(
  1. String text
)

text as this case draws it. The string in the file is left alone — a kicker is typed in the language it reads in and drawn in caps, and what an importer or a translator sees is still the sentence.

Implementation

String apply(String text) => switch (this) {
  none => text,
  upper => text.toUpperCase(),
  lower => text.toLowerCase(),
  title =>
    text
        .split(' ')
        .map((w) => w.isEmpty ? w : w[0].toUpperCase() + w.substring(1))
        .join(' '),
};