Sass str-length() Function

Last Updated:

Sass str-length() Function

The str-length() function returns the number of characters in a string.

Example

SASS TO CSS CONVERTER
//Check your console @debug str-length("sans-serif"); // 10 @debug str-length("30px"); // 4 @debug str-length(""); // 0

Syntax

str-length($string)

Parameter Value

ValueTypeExplanation
$string Optional A string.

Return Value

ValueExplanation
Number Returns the number of characters in $string.

Share this Page

Meet the Author