{"id":924,"date":"2018-09-17T18:27:12","date_gmt":"2018-09-17T09:27:12","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=924"},"modified":"2018-12-23T02:00:53","modified_gmt":"2018-12-22T17:00:53","slug":"file-getpreffix","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/ko\/blog\/java\/\ud30c\uc77c-getpreffix","title":{"rendered":"Java \ud30c\uc77c \uc774\ub984\uc5d0\uc11c \ud655\uc7a5\uc790 \uc81c\uac70"},"content":{"rendered":"<h2 class=\"common_title\"><a name=\"0\">Java \ud30c\uc77c \uc774\ub984\uc5d0\uc11c \ud655\uc7a5\uc790 \uc81c\uac70<\/a><\/h2>\n<p>\nJava\uc5d0\uc11c<strong>\ud30c\uc77c \uc774\ub984<\/strong>\uc5d0\uc11c<strong>\ud655\uc7a5\uc790<\/strong>\ub97c \uc81c\uac70\ud55c \uc774\ub984\uc744 \ub3cc\ub824\uc8fc\ub294 \uc0d8\ud50c \uc18c\uc2a4\uc785\ub2c8\ub2e4.\n<\/p>\n<h2 class=\"common_title\"><a name=\"1\">\uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8<\/a><\/h2>\n<pre class=\"sample_src\">\/** * \ud30c\uc77c \uc774\ub984\uc5d0\uc11c \ud655\uc7a5\uc790\ub97c \uc81c\uac70\ud55c \uc774\ub984\uc744 \ubc18\ud658\ud569\ub2c8\ub2e4. * @param fileName \ud30c\uc77c\uba85 * @return \ud30c\uc77c\uba85 *\/ public static String getPreffix(String fileName) { if (fileName == null) return null; int point = fileName.lastIndexOf(&quot;.&quot;); if (point != - 1) { return fileName.substring(0, point); } return fileName; }\r\n<\/pre>\n<p><script type=\"text\/javascript\" src=\"https:\/\/chat-messenger.com\/js\/common.js?dd12sssas2223\" charset=\"UTF-8\"><\/script><br \/>\n<script type=\"text\/javascript\"> writePR(); <\/script><\/p>\n<h2 class=\"common_title\"><a name=\"2\">\uc2e4\ud589 \uacb0\uacfc<\/a><\/h2>\n<p>\u25c6\uc2e4\ud589\uc608<\/p>\n<pre class=\"sample_src\">\/** * \uc608\uc81c \uc2e4\ud589 * @param args *\/ public static void main(String[] args) { String ret1 = getPreffix(&quot;test.html&quot;); System.out.println(ret1); String ret2 = getPreffix(&quot; C:\\\\test.html&quot;); System.out.println(ret2); }\r\n<\/pre>\n<p>\u25c6\ucd9c\ub825 \uacb0\uacfc<\/p>\n<pre class=\"console\">test C:\\test\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>Java \ud30c\uc77c \uc774\ub984\uc5d0\uc11c \ud655\uc7a5\uc790 \uc81c\uac70 Java\uc5d0\uc11c \ud30c\uc77c \uc774\ub984\uc5d0\uc11c \ud655\uc7a5\uc790\ub97c \uc81c\uac70\ud55c \uc774\ub984\uc744 \ubc18\ud658\ud558\ub294 \uc0d8\ud50c \uc18c\uc2a4\uc5d0\uc11c [\u2026]<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/924"}],"collection":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/comments?post=924"}],"version-history":[{"count":4,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/924\/revisions"}],"predecessor-version":[{"id":1891,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/924\/revisions\/1891"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/media?parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/categories?post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/tags?post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}