반응형
Notice
Link
목록문자열컴퓨팅 (1)
스택큐힙리스트
자바스크립트에서 문자열에 부분 문자열이 포함되어 있는지 확인하는 방법은 무엇인가요?
이 문제의 답변들은 community effort 입니다. 기존의 답변을 편집하여 이 게시물을 개선하세요. 새로운 답변이나 상호작용은 현재 받지 않습니다.일반적으로 String.contains() 메소드를 예상하지만, 그런 것 같지 않습니다.이를 확인하는 합리적인 방법은 무엇인가요?답변 1ECMAScript 6에서는 String.prototype.includes가 소개되었습니다. const string = foo;const substring = oo;console.log(string.includes(substring)); // trueString.prototype.includes은 대소문자를 구분하며, is not supported by Internet Explorer은 polyfill가 없습니다.ECM..
카테고리 없음
2023. 3. 10. 21:59