#!/usr/bin/ruby # -*- coding: utf-8 -*- =begin 파일명에서 확장자 추출 =end str = "hello.txt" puts File.extname(str)