In Sass, strings are indexed starting from 1, not 0.
We have created a table that contains the list of all SASS functions with a brief description and examples.
1. quote($string) Function:
This function applies quotation marks to an unquoted string and outputs the string with quotes.
quote(GeeksforGeeks);
"GeeksforGeeks"
2. str-index($string, $substring) Function:
This function retrieves the index of the first occurrence of a substring within a specified string. If the substring is not found, it returns null.
str-index(“Geeksforgeeks”, “G”);
1
3. str-insert($string, $insert, $index) Function:
This function provides a duplicated version of the provided string with a string inserted at a specified index.
str-insert(“forGeeks”, “Geeks”, 0);
"GeeksforGeeks"
4. str-length($string) Function:
This function calculates and returns the count of characters within the provided string.
str-length(“GeeksforGeeks”);
13
5. str-slice($string, $start-at, $end-at: -1) Function:
This function retrieves a portion of the string between the specified start and end indices, including both indices.
str-slice(“GeeksforGeeks”, 8);
str-slice(“GeeksforGeeks”, 6, 8);
"Geeks"
6. to-upper-case($string) Function:
This function generates a duplicate of the provided string, with all ASCII letters converted to uppercase.
to-upper-case(“geeksforgeeks”);
"GEEKSFORGEEKS"
7. to-lower-case($string) Function:
This function creates a duplicate of the given string with all ASCII letters converted to lowercase.
to_lower_case(“geeksforgeeks!”)
"geeksforgeeks"
8. unique-id() Function:
This function generates a random unquoted string that conforms to the rules of a valid CSS identifier.
unique-id();
andomly Generated ID
9. unquote($string) Function:
This function returns the unquoted version of a quoted string.
GeeksforGeeks