Compatibility:
Only Dart Sass currently supports loading built-in modules with @use
. Users of other implementations must call functions using their global names instead.
string.quote($string)
quote($string)
Returns $string
as a quoted string.
string.index($string, $substring)
str-index($string, $substring)
Returns the first index of $substring
in $string
, or null
if $string
doesn’t contain $substring
.
string.insert($string, $insert, $index)
str-insert($string, $insert, $index)
Returns a copy of $string
with $insert
inserted at $index
.
If $index
is higher than the length of $string
, $insert
is added to the end. If $index
is smaller than the negative length of the string, $insert
is added to the beginning.
string.length($string)
str-length($string)
Returns the number of characters in $string
.
string.slice($string, $start-at, $end-at: -1)
str-slice($string, $start-at, $end-at: -1)
Returns the slice of $string
starting at index $start-at
and ending at index $end-at
(both inclusive).
@use "sass:string";
@debug string.slice("Helvetica Neue", 11);
@debug string.slice("Helvetica Neue", 1, 3);
@debug string.slice("Helvetica Neue", 1, -6);
Playground Sass Syntax
@use "sass:string"
@debug string.slice("Helvetica Neue", 11) // "Neue"
@debug string.slice("Helvetica Neue", 1, 3) // "Hel"
@debug string.slice("Helvetica Neue", 1, -6) // "Helvetica"
string.split($string, $separator, $limit: null)
Compatibility:
Returns a bracketed, comma-separated list of substrings of $string
that are separated by $separator
. The $separator
s aren’t included in these substrings.
If $limit
is a number 1
or higher, this splits on at most that many $separator
s (and so returns at most $limit + 1
strings). The last substring contains the rest of the string, including any remaining $separator
s.
string.to-upper-case($string)
to-upper-case($string)
Returns a copy of $string
with the ASCII letters converted to upper case.
string.to-lower-case($string)
to-lower-case($string)
Returns a copy of $string
with the ASCII letters converted to lower case.
string.unique-id()
unique-id()
Returns a randomly-generated unquoted string that’s guaranteed to be a valid CSS identifier and to be unique within the current Sass compilation.
string.unquote($string)
unquote($string)
Returns $string
as an unquoted string. This can produce strings that aren’t valid CSS, so use with caution.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4