Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 백준알고리즘
- filter()
- Em
- Link
- CSS
- 단방향 연결리스트
- 배열의 내림차순
- map()
- 객체
- 가상 요소 선택자
- 배열의 오름차순
- 양방향 연결리스트
- invalid assignment left-hand side
- innerhtml
- classList.contains(string)
- indexOf
- 고차함수
- display : none
- 등차수열의 항 찾기
- 쌍방향 연결리스트
- 인접 형제 선택자 결합
- 배열과 연결리스트의 차이
- 일반 형제 선택자 결합
- disabled
- 범용 선택자
- for..of
- visibility : hidden
- Array.from()
- nth-child()
- Sort
Archives
- Today
- Total
프론트엔드 센트럴파크 (☞゚ヮ゚)☞
String 관련 method 본문
indexOf
: 앞에서 부터 입력한 문자열의 자리를 index로 찾아주는 기능
indexOf(" ", )
: 지정 한 숫자 index 뒤 부터 세어라 (띄어쓰기 포함)
let str = "hello, world!!";
console.log(str.indexOf("l")); // output : 2
console.log(str.indexOf("l", 5)); // output : 10
lastIndexOf()
: 뒤에서 부터
let str = "hello, world!!";
console.log(str.lastIndexOf("r")); // output : 9
includes()
: () 안의 문자가 포함되어 있는지 (대소문자 구별하여)
let str = "hello, world!!";
console.log(str.includes("hello")); // output : true
startsWith()
: 시작하는 문자가 () 와 일치한가
let str = "hello, world!!";
console.log(str.startsWith("ello")); // output : false
console.log(str.startsWith("hello")); // output : true
endsWith()
: 뒤에서 부터 문자열이 () 와 일치한가
let str = "hello, world!!";
console.log(str.endsWith("!!!")); // output : false
console.log(str.endsWith("!!")); // output : true
'Javascript' 카테고리의 다른 글
배열탐색 - indexOf, lastIndexOf, includes (0) | 2022.05.24 |
---|---|
배열조작 - push, pop, splice, slice, concat, for (0) | 2022.05.23 |
Number 관련 method (0) | 2022.05.11 |
다이나믹 파라미터 (0) | 2022.05.10 |
for .. in 반복문 (0) | 2022.05.05 |
Comments