A string is a sequence of characters (letters, digits, punctuation, etc.).
Tell a student what a string is in your language, how strings can be manipulated, and ensure they understand where to look for docs on strings.
- Explain what strings are in your language? Is it a sequence of bytes, UTF-8 characters or something else? Are strings objects or primitives?
- How are strings brought together? Do you join strings, add strings, concatenate strings, interpolate strings? It's worth giving a hint as to which is normal, or letting the student know all are ok!
- How are strings split apart? How do I extract a bit of a string?
- Where do helper methods for strings live? If I want to trim a string, or check it's length, how do I do that in your language? Are these string methods or functions that act on strings?
This exercise customizes an ASCII heart with initials of given two full names. The reference implementation (Elixir) teaches:
- String concatenation
- String interpolation
- Trimming
- Changing casing (uppercase)
- Extracting substrings (first letter)
- Multiline strings
Track | Exercise | Changes |
---|---|---|
Elixir | strings | None |
This exercise extracts information from log lines. The reference implementation (C#) teaches:
- String concatenation
- Trimming
- Changing casing
- Extracting substrings
Track | Exercise | Changes |
---|---|---|
C++ | strings | None |
C# | log-levels | None |
F# | strings | None |
Ruby | strings | None |
Python | strings | None |
Go | strings-package | None |
This exercise is a conversation between you and the security guard. The reference implementation (JavaScript) teaches:
- String substrings (first, last letter)
- String casing (Word capitalization, normalisation).
- String reversing
- String concatenation
Track | Exercise | Changes |
---|---|---|
JavaScript | strings | None |
This exercise implements some phrases an eccentric party robot would say.
- String introduction
- String formatting
Track | Exercise | Changes |
---|---|---|
Go | strings | None |