From 2a0212376723f736d69b19446317f474ade11baf Mon Sep 17 00:00:00 2001 From: woznotwoz Date: Tue, 15 Jul 2025 16:50:38 -0700 Subject: Create README --- challenge-330/woznotwoz/README | 1 + 1 file changed, 1 insertion(+) create mode 100644 challenge-330/woznotwoz/README diff --git a/challenge-330/woznotwoz/README b/challenge-330/woznotwoz/README new file mode 100644 index 0000000000..4304358aab --- /dev/null +++ b/challenge-330/woznotwoz/README @@ -0,0 +1 @@ +Solution by Harry Wozniak -- cgit From 5286bf621666c377bdfb7fdebce4bf9d1992a2a5 Mon Sep 17 00:00:00 2001 From: woznotwoz Date: Tue, 15 Jul 2025 16:53:59 -0700 Subject: Create ch-330.pl --- challenge-330/woznotwoz/perl/ch-330.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 challenge-330/woznotwoz/perl/ch-330.pl diff --git a/challenge-330/woznotwoz/perl/ch-330.pl b/challenge-330/woznotwoz/perl/ch-330.pl new file mode 100644 index 0000000000..f6b65f32e5 --- /dev/null +++ b/challenge-330/woznotwoz/perl/ch-330.pl @@ -0,0 +1,16 @@ +#! perl +use v5.40.0; +use Test2::V0 -no_srand => 1; + +is remove_digits('cab12'), 'c', 'first example'; +is remove_digits('xy99'), '', 'second example'; +is remove_digits('99999xy'), 'xy', 'third example'; +done_testing; + +sub remove_digits ($str) { + $str = substr($str,1) while $str =~ /^\d/; + while ($str =~ /\d/) { + $str =~ s/.\d//; + } + $str; +} -- cgit