endswith 함수

endswith 함수

endswith는 두 값을 받아요: 확인할 문자열과 접미사(suffix) 문자열. 첫 번째 문자열이 그 정확한 접미사로 끝나면 함수는 true를 반환해요.

endswith(string, suffix)

출처: Packer 공식 문서

본문

예시 (Examples)

> endswith("hello world", "world")
true
> endswith("hello world", "hello")
false
  • startswith는 두 값을 받아요: 확인할 문자열과 프리픽스(prefix) 문자열. 문자열이 그 정확한 프리픽스로 시작하면 함수는 true를 반환해요.