caesarShift static method
Implementation
static String caesarShift(String text, int shift) {
final int n = ((shift % 26) + 26) % 26;
return String.fromCharCodes(
text.runes.map((int c) {
if (c >= 65 && c <= 90) return (c - 65 + n) % 26 + 65;
if (c >= 97 && c <= 122) return (c - 97 + n) % 26 + 97;
return c;
}),
);
}