본문 바로가기
Beakjoon&프로그래머스/Java

[프로그래머스/Java] 접두사인지 확인하기

by 현장 2025. 2. 11.

-Code

class Solution {
    public int solution(String my_string, String is_prefix) {
        return my_string.startsWith(is_prefix) ? 1 : 0;
    }
}