0
0
SASSmarkup~10 mins

sass:string module - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to convert the string to uppercase using the sass:string module.

SASS
@use "sass:string";

$result: string.[1]("hello world");
Drag options to blanks, or click blank then click option'
Ato-upper-case
Bto-upper-case()
Cuppercase
Dto-upper
Attempts:
3 left
💡 Hint
Common Mistakes
Adding parentheses in the function name inside the code.
Using 'uppercase' instead of 'to-upper-case'.
Using 'to-upper' which is not a valid function.
2fill in blank
medium

Complete the code to check if the string "Sass" starts with the letter "S".

SASS
@use "sass:string";

$is-start: string.[1]("Sass", "S") == 1;
Drag options to blanks, or click blank then click option'
Aindex
Bstart-with
Chas-prefix
Dbegins-with
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'begins-with' which is not a valid function.
Using 'start-with' which is not a valid function.
Using 'has-prefix' which is not a sass:string function.
3fill in blank
hard

Fix the error in the code to get the length of the string "Sass" using the sass:string module.

SASS
@use "sass:string";

$len: string.[1]("Sass");
Drag options to blanks, or click blank then click option'
Alen
Blength()
Clength
Dsize
Attempts:
3 left
💡 Hint
Common Mistakes
Adding parentheses in the function name.
Using 'len' which is not a sass:string function.
Using 'size' which is not a sass:string function.
4fill in blank
hard

Complete the code to extract the substring "ass" from "Sass" using the sass:string module.

SASS
@use "sass:string";

$sub: string.[1]("Sass", 2, 4);
Drag options to blanks, or click blank then click option'
Acut
Bsubstr
Csubstring
Dslice
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'substr' as the function name instead of 'slice'.
Using 'substring' which is not a sass:string function.
Using 'cut' which is not a sass:string function.
5fill in blank
hard

Fill all three blanks to replace all occurrences of "s" with "z" in "sass" using the sass:string module.

SASS
@use "sass:string";

$new-str: string.[1]("sass", "[2]", "[3]", 0, $flags: "i");
Drag options to blanks, or click blank then click option'
Areplace-all
Bs
Cz
Dreplace
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'replace-all' which is not a valid function.
Swapping the letters in the second and third blanks.
Not using the 'i' flag for case-insensitive replacement.