📜
Starts With
Starts With쉬움 문자열 +10pts
Problem
Write a function that checks if a string starts with a given prefix.
Examples
Input:
startsWith("hello", "he")Output:
trueExplanation
이 문제는 **startsWith() 메서드**로 문자열의 시작을 확인하는 방법을 학습합니다. ## 핵심 개념: 접두사 확인 startsWith()는 문자열이 특정 문자열로 시작하는지 확인합니다. ### 기본 사용법 ```javascript str.startsWith(searchString) str.startsWith(searchString, position) ``` - searchString: 찾을 접두사 - position: 검색 시작 위치 (기본값 0) ### 활용 예시 ```javascript "hello".start...
View detailed explanation →Key Concepts
startsWith 메서드 접두사 확인 문자열 검사 ES6 메서드
Time: O(m) Space: O(1)
solution.js
Ctrl + Enter
Run tests to see results here.