Javascript 문자에서 접두사 검색

2024. 12. 5. 16:37Javascript

var str = "extTreePanel";

if (str.startsWith('ext')) {
    console.log("The string starts with 'ext'.");
} else {
    console.log("The string does not start with 'ext'.");
}