From e99579328003d3e4712b574f45e1fa2d55c7d573 Mon Sep 17 00:00:00 2001 From: Abigail Date: Fri, 29 Jan 2021 20:31:33 +0100 Subject: No need to split a string into individual characters --- challenge-097/abigail/awk/ch-1.awk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/challenge-097/abigail/awk/ch-1.awk b/challenge-097/abigail/awk/ch-1.awk index a33507ee33..c93f4a123e 100644 --- a/challenge-097/abigail/awk/ch-1.awk +++ b/challenge-097/abigail/awk/ch-1.awk @@ -32,13 +32,12 @@ BEGIN { } { - split($0, letters, "") out = "" # # Iterate over the individual letters, shifting capital letters # for (i = 1; i <= length (letters); i ++) { - char = letters [i] + char = substr ($0, i, 1) if (ord [char]) { n = ord [char] - shift if (n < ORD_A) { -- cgit