Switch node

This commit is contained in:
space-nuko
2023-05-26 12:59:38 -05:00
parent 521ebb0ccf
commit 8e27a2611c
8 changed files with 176 additions and 16 deletions

View File

@@ -610,3 +610,15 @@ export async function readFileToText(file: File): Promise<string> {
reader.readAsText(file);
})
}
export function nextLetter(s: string): string {
return s.replace(/([a-zA-Z])[^a-zA-Z]*$/, function(a) {
var c = a.charCodeAt(0);
switch (c) {
case 90: return 'A';
case 122: return 'a';
default: return String.fromCharCode(++c);
}
});
}