From 4efb34bd728732101432843ed0bfbeb971272287 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 21 Dec 2023 14:03:41 +0000 Subject: Add chapters --- lessons/src/lesson024_string_patterns/code.gleam | 14 -------------- lessons/src/lesson024_string_patterns/text.html | 9 --------- 2 files changed, 23 deletions(-) delete mode 100644 lessons/src/lesson024_string_patterns/code.gleam delete mode 100644 lessons/src/lesson024_string_patterns/text.html (limited to 'lessons/src/lesson024_string_patterns') diff --git a/lessons/src/lesson024_string_patterns/code.gleam b/lessons/src/lesson024_string_patterns/code.gleam deleted file mode 100644 index d1441a0..0000000 --- a/lessons/src/lesson024_string_patterns/code.gleam +++ /dev/null @@ -1,14 +0,0 @@ -import gleam/io - -pub fn main() { - io.debug(get_name("Hello, Joe")) - io.debug(get_name("Hello, Mike")) - io.debug(get_name("System still working?")) -} - -fn get_name(x: String) -> String { - case x { - "Hello, " <> name -> name - _ -> "Unknown" - } -} diff --git a/lessons/src/lesson024_string_patterns/text.html b/lessons/src/lesson024_string_patterns/text.html deleted file mode 100644 index 0dd3274..0000000 --- a/lessons/src/lesson024_string_patterns/text.html +++ /dev/null @@ -1,9 +0,0 @@ -

- When pattern matching on strings the <> operator can be - used to match on strings with a specific prefix. -

-

- The pattern "hello " <> name matches any string that starts with - "hello " and asigns the rest of the string to the variable - name. -

-- cgit v1.2.3