Color theme
0 day streak0 XPP1
ElixirLearn mode
MISSION 1 OF 1

Normalize a weather topic

0 XP earned
Elixir track: AdvancedMission: BeginnerPipelinesString replacementText normalization
Before you start this advanced track

Functions and collections. Work with immutable data, tuples, atoms, and pattern matching.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 2 challenges
LEARN THE CONCEPT

Understand it, then try it.

The pipe operator passes the result on its left into the first argument of the next function. A topic label travels through three clear steps: remove surrounding whitespace, replace internal spaces with hyphens, and uppercase the letters. Each function returns a new string for the next stage.

observatory.exs
raw = "  coastal weather  "slug =  raw  |> String.trim()  |> String.replace(" ", "-")  |> String.upcase()IO.puts(slug)

Each mission is a standalone Elixir script run with elixir. Only standard-library modules are used. Answers describe printed output, excluding any extra value an interactive IEx session would echo.

Track the values line by line. Predict the result before running this example in your own editor.