str_insert

str_insert($string, $insert, $index)

Inserts $insert into $string at $index.

Note that unlike some languages, the first character in a Sass string is number 1, the second number 2, and so forth.

Examples:

str-insert("abcd", "X", 1) => "Xabcd"
str-insert("abcd", "X", 4) => "abcXd"
str-insert("abcd", "X", 5) => "abcdX"

Parameters:

  • $string (String)
  • $insert (String)
  • $index (Number) The position at which $insert will be inserted. Negative indices count from the end of $string. An index that’s outside the bounds of the string will insert $insert at the front or back of the string

Returns:

  • (String) The result string. This will be quoted if and only if $string was quoted

Raises:

  • (ArgumentError) if any parameter is the wrong type
doc_Sass
2016-11-11 13:09:26
Comments
Leave a Comment

Please login to continue.