0
0
SASSmarkup~5 mins

sass:string module - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Aindex()
Bslice()
Cto-upper-case()
Dlength()
What will to-upper-case('hello') return?
A'hello'
B'HELLO'
C'Hello'
D'hElLo'
How do you extract characters 2 to 4 from the string 'Sass' using sass:string?
Aslice('Sass', 2, 4)
Bindex('Sass', 2, 4)
Cto-lower-case('Sass', 2, 4)
Dsubstring('Sass', 2, 4)
If a substring is not found, what does index() return?
A0
B1
C-1
Dnull
Which function changes all letters in a string to lowercase?
Aslice()
Bto-upper-case()
Cto-lower-case()
Dindex()
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.