2014년 1월 9일 목요일

[9-3] String클래스의 메서드 활용

class Exercise9_3 {
public static void main (String[] args) {
String fullPath = "c:\\jdk1.5\\work\\PathSeparateTest.java";
String path = " ";
String fileName = " ";

path = fullPath.substring (0, fullPath.lastIndexOf ('\\') );
fileName = fullPath.substring(fullPath.lastIndexOf ('\\')+1);


System.out.println("fullPath : "+fullPath);
System.out.println("path : "+path);
System.out.println("fileName : "+fileName);
}
}

댓글 없음:

댓글 쓰기