Home »
MCQs »
SASS MCQs
Which Sass function is used to get the index of the first occurrence of the substring within string?
18. Which Sass function is used to get the index of the first occurrence of the substring within string?
- index(string, substring)
- strindex(string, substring)
- str-index(string, substring)
- get (string, substring)
Answer: C) str-index(string, substring)
Explanation:
The str-index(string, substring) function is used to get the index of the first occurrence of the substring within string.
Example:
str-index("IncludeHelp", "n")
Result: 2