StaffCoder
C+
C++C++
6 modules · 26 challengesSign up
Module 3 of 6 · 4 challenges

C++ Strings & string_view

Learn how to search and slice std::string, clean text character by character with <cctype>, pass text cheaply as std::string_view, align output with std::format, and pull the fields out of chat log lines.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Chat Command Parser

Sign up to unlock
—No data yeteasy
About this challenge

Parse game chat commands with std::string: detect a slash command, slice out its name and arguments, and build a tagged name.

Solved in a browser IDE and graded by tests. Sign up to solve

Player Name Cleanup

Sign up to unlock
—No data yeteasy
About this challenge

Clean player names character by character with <cctype>: trim whitespace, fold to lower case and check the lobby's name rule.

Solved in a browser IDE and graded by tests. Sign up to solve

Scoreboard Lines

Sign up to unlock
—No data yeteasy
About this challenge

Format scoreboard text through std::string_view parameters with std::format: aligned columns, a one-decimal accuracy label and a character count.

Solved in a browser IDE and graded by tests. Sign up to solve

Log Line Fields

STAR
Solving it completes the module
—No data yeteasy
About this challenge

Split game server log lines into time, level, player and message through std::string_view, clean each field, check the player name rule and format a summary line.

Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.