목차
- quote() 함수 - 따옴표 추가
- str-index() 함수 - 문자열 위치 (= 색인번호)
- str-insert() 함수 - 문자열 삽입
- str-length() 함수 - 문자열 길이
- str-slice() 함수 - 문자열 자르기
- to-lower-case() 함수 - 소문자로 변환
- to-upper-case() 함수 - 대문자로 변환
- unique-id() 함수 - 랜덤 유일키
- unquote() 함수 - 따옴표 제거
※ Sass 문자열 인덱스는 1부터 시작. (주의: 0 아님.)
quote() 함수 - 따옴표 추가
quote(string)
문자열에 따옴표 추가 후 결과값 반환.
(예제)
quote(Hello world!)
Result: "Hello world!"
str-index() 함수 - 문자열 위치 (= 색인번호)
str-index(string, substring)
문자열 안에서 특정 문자의 색인번호 반환.
(예제)
str-index("Hello world!", "H")
Result: 1
str-insert() 함수 - 문자열 삽입
str-insert(string, insert, index)
문자열 내 특정 위치에 문자열 삽입 후, 결과값 반환.
(예제)
str-insert("Hello world!", " wonderful", 6)
Result: "Hello wonderful world!"
str-length() 함수 - 문자열 길이
str-length(string)
문자열 길이를 글자 개수로 반환.
(예제)
str-length("Hello world!")
Result: 12
str-slice() 함수 - 문자열 자르기
str-slice(string, start, end)
문자열 시작 위치에서 끝 위치까지의 문자열을 반환.
(예제)
str-slice("Hello world!", 2, 5)
Result: "ello"
to-lower-case() 함수 - 소문자로 변환
to-lower-case(string)
문자열을 소문자로 변환.
(예제)
to-lower-case("Hello World!")
Result: "hello world!"
to-upper-case() 함수 - 대문자로 변환
to-upper-case(string)
문자열을 대문자로 변환.
(예제)
to-upper-case("Hello World!")
Result: "HELLO WORLD!"
unique-id() 함수 - 랜덤 유일키
unique-id()
따옴표 없는 랜덤 유일키 반환. (현재 SASS 세션에서 유일 담보.)
(예제)
unique-id()
Result: tyghefnsv
unquote() 함수 - 따옴표 제거
unquote(string)
문자열에서 따옴표 제거.
(예제)
unquote("Hello world!")
Result: Hello world!
최신댓글