문서
API
Chosungincludes

chosungIncludes (deprecated, choseongIncludes를 사용해주세요)

문자열의 초성 일치 검색을 수행합니다.

function chosungIncludes(
  // 초성 일치하는지 검사할 문자열 (e.g. '프론트엔드')
  x: string,
  // 초성 문자열 (e.g. 'ㅍㄹㅌㅇㄷ')
  y: string
): boolean;
chosungIncludes('프론트엔드', 'ㅍㄹㅌ'); // true
chosungIncludes('00프론트엔드', 'ㅍㄹㅌ'); // true
chosungIncludes('프론트엔드', 'ㅍㅌ'); // false
chosungIncludes('프론트엔드', '푸롴트'); // false

사용해보기


import { choseongIncludes } from 'es-hangul';

console.log(choseongIncludes('프론트엔드', 'ㅍㄹㅌ'));