str-split()
문자 값에서 분리 기호를 찾아 리스트를 반환하는 유틸리티 함수
용도
사용법
@debug str-split(".img, .button", ","); // ".img" ".button" 반환로직
@function str-split($string, $separator: ',') {
$split-list: ();
$index: str-index($string, $separator);
@while $index != null {
$item: str-slice($string, 1, $index - 1);
$split-list: append($split-list, $item);
$string: str-slice($string, $index + 1);
$index: str-index($string, $separator);
}
@return append($split-list, $string);
}참고
Last updated