|
| 1 | +## Design |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +The goal of this exercise is to teach helpful string manipulation methods and how to use them in Python. |
| 6 | + |
| 7 | +## Learning objectives |
| 8 | + |
| 9 | +- Know the `str` class and its core methods |
| 10 | +- Know when to use methods of str to operate on a string |
| 11 | +- Use several of the methods from each grouping below to operate on strings |
| 12 | +- Check if a given string ends/begins with the a specified suffix/prefix with the `endswith()`/ `startswith()` methods |
| 13 | +- Check if a given string is composed of certain code points/characters by using `isalnum()`, `isalph()`, `isascii()`, `isdecimal()`, `isdigit()`, or `isnumeric()` methods. |
| 14 | +- Return a new string that is a transform of the input string using `capitalize()`, `lower()`, `casefold()`, `swapcase()`, `upper()`, or `title()` methods |
| 15 | +- Return a new string that has leading/trailing whitespaces removed with `lstrip()`, `rstrip()`, or `strip()` methods |
| 16 | +- Check if a given substring is contained within a given string using `in` |
| 17 | +- Return a new string that replaces a given substring with a new value using the `replace()` method |
| 18 | +- Build a new string from an input iterable with `join()` |
| 19 | + |
| 20 | +## Out of scope |
| 21 | + |
| 22 | +- string formatting methods, "f-strings", "format strings" |
| 23 | +- string splitting |
| 24 | +- string translate methods (will have their own exercise) |
| 25 | +- string constants from the string module |
| 26 | +- built-ins that can take a str as an argument |
| 27 | +- encoding/decoding & codecs |
| 28 | +- the binary sequence types bytes, bytearray, and memoryview |
| 29 | +- binary transforms and text transforms |
| 30 | +- text encodings |
| 31 | + |
| 32 | +## Concepts |
| 33 | + |
| 34 | +- `string-methods` |
| 35 | + |
| 36 | +## Prerequisites |
| 37 | + |
| 38 | +- `booleans` |
| 39 | +- `strings` |
| 40 | +- `sequences`, `sequence type` |
| 41 | +- `iteration` |
0 commit comments