Recall & Review
beginner
What is the
sass:string module used for?The
sass:string module provides functions to work with strings in Sass, like changing case, slicing, and finding substrings.Click to reveal answer
beginner
How do you convert a string to uppercase using
sass:string?Use the
to-upper-case($string) function to change all letters in a string to uppercase.Click to reveal answer
intermediate
What does the
index($string, $substring) function do in sass:string?It returns the position (1-based) of the first occurrence of
$substring inside $string. Returns null if not found.Click to reveal answer
intermediate
How can you get a part of a string in Sass using the
sass:string module?Use the
slice($string, $start-at, $end-at) function to extract a substring from $start-at (inclusive) up to and including $end-at (both 1-based indexes).Click to reveal answer
beginner
What is the difference between
to-upper-case() and to-lower-case() in sass:string?to-upper-case() changes all letters to uppercase, while to-lower-case() changes all letters to lowercase.Click to reveal answer
Which function from
sass:string returns the position of a substring inside a string?✗ Incorrect
The
index() function returns the 1-based position of a substring inside a string.What will
to-upper-case('hello') return?✗ Incorrect
to-upper-case() converts all letters to uppercase, so it returns 'HELLO'.How do you extract characters 2 to 4 from the string 'Sass' using
sass:string?✗ Incorrect
slice() extracts a substring from start to end positions, so slice('Sass', 2, 4) returns 'ass'.If a substring is not found, what does
index() return?✗ Incorrect
index() returns null when the substring is not found.Which function changes all letters in a string to lowercase?
✗ Incorrect
to-lower-case() converts all letters in a string to lowercase.Explain how to find the position of a substring inside a string using the
sass:string module.Think about how you look for a word inside a sentence and want to know where it starts.
You got /3 concepts.
Describe how to change the case of letters in a string with
sass:string functions.Imagine you want all your text to be uppercase or lowercase for style.
You got /4 concepts.