{"id":1346,"date":"2011-02-09T06:24:11","date_gmt":"2011-02-09T06:24:11","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=1346"},"modified":"2017-01-28T12:48:42","modified_gmt":"2017-01-28T03:48:42","slug":"actionscript-%eb%ac%b8%ec%9e%90%ec%97%b4%ec%97%90-%eb%8c%80%ed%95%9c-trim-%ed%95%a8%ec%88%98","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=1346","title":{"rendered":"[ActionScript] \ubb38\uc790\uc5f4\uc5d0 \ub300\ud55c Trim \ud568\uc218"},"content":{"rendered":"<p>\uc561\uc158 \uc2a4\ud06c\ub9bd\ud2b8\ub294 \ubb38\uc790\uc5f4\uc5d0 \ub300\ud55c Trim \ud568\uc218\ub97c \uc81c\uacf5\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \ud574\uc11c \uc81c\uac00 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 Trim \ud568\uc218\ub97c \uc18c\uac1c\ud574 \ub4dc\ub9bd\ub2c8\ub2e4. \uc7ac\uadc0\ud638\ucd9c \ud568\uc218\ub97c \uc0ac\uc6a9\ud574\uc11c \uadf8\ub2e4\uc9c0 \uc18d\ub3c4\ub294 \ub098\uc9c8 \uc54a\uc9c0\ub9cc&#8230;. \uc81c\uac00 \uc0ac\uc6a9\ud568\uc5d0 \uc788\uc5b4\uc11c \ubb38\uc81c\uac00 \uc5c6\uae30\uc5d0 \uc18c\uac1c\ud574 \ub4dc\ub9bd\ub2c8\ub2e4.<\/p>\n<pre>public class StringHelper\r\n{\r\n\u00a0 \u00a0 static public function trim(str:String, char:String):String {\r\n\u00a0 \u00a0 \u00a0 \u00a0 return trimBack(trimFront(str, char), char);\r\n\u00a0 \u00a0 }\r\n\u00a0 \r\n\u00a0 \u00a0 static public function trimFront(str:String, char:String):String {\r\n\u00a0 \u00a0 \u00a0 \u00a0 char = stringToCharacter(char);\r\n\u00a0 \u00a0\u00a0 \u00a0 \u00a0if (str.charAt(0) == char) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 str = trimFront(str.substring(1), char);\r\n\u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0\u00a0 \u00a0 \u00a0return str;\r\n\u00a0 \u00a0 }\r\n\u00a0 \r\n\u00a0 \u00a0 static public function trimBack(str:String, char:String):String {\r\n\u00a0 \u00a0 \u00a0 \u00a0 char = stringToCharacter(char);\r\n\u00a0 \u00a0\u00a0 \u00a0 \u00a0if (str.charAt(str.length - 1) == char) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 str = trimBack(str.substring(0, str.length - 1), char);\r\n\u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 \u00a0 \u00a0 return str;\r\n\u00a0 \u00a0 }\r\n\r\n\u00a0 \u00a0 static public function stringToCharacter(str:String):String {\r\n\u00a0 \u00a0 \u00a0 \u00a0 if (str.length == 1) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return str;\r\n\u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 \u00a0 \u00a0 return str.slice(0, 1);\r\n\u00a0 \u00a0 }\r\n}<\/pre>\n<p>\uc0ac\uc6a9\ubc29\ubc95\uc740 StringHelper.trim(&#8221; \u00a0\u00a0 ABC \u00a0\u00a0 &#8220;, &#8221; &#8220;)\uc640 \uac19\uc73c\uba70 \uc774\uc5d0 \ub300\ud55c \uacb0\uacfc\ub294 &#8220;ABC&#8221;\uac00 \ub429\ub2c8\ub2e4. \ucc38\uace0\ub85c \uc774 \ud568\uc218\ub294 \uc81c\uac00 \ub9cc\ub4e0 \uac83\uc774 \uc544\ub2c8\uace0 \uc678\uad6d\uc758 \ube14\ub85c\uadf8\uc5d0\uc11c \ubc1c\ucdcc\ud574 \uc0ac\uc6a9\ud55c \uac83\uc778\ub370&#8230; \uc5b4\ub290 \ube14\ub85c\uadf8\uc778\uc9c0.. \uc2dc\uac04\uc774 \ub9ce\uc774 \ud758\ub7ec \uc54c\uc218\uac00 \uc5c6\ub124\uc694..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc561\uc158 \uc2a4\ud06c\ub9bd\ud2b8\ub294 \ubb38\uc790\uc5f4\uc5d0 \ub300\ud55c Trim \ud568\uc218\ub97c \uc81c\uacf5\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \ud574\uc11c \uc81c\uac00 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 Trim \ud568\uc218\ub97c \uc18c\uac1c\ud574 \ub4dc\ub9bd\ub2c8\ub2e4. \uc7ac\uadc0\ud638\ucd9c \ud568\uc218\ub97c \uc0ac\uc6a9\ud574\uc11c \uadf8\ub2e4\uc9c0 \uc18d\ub3c4\ub294 \ub098\uc9c8 \uc54a\uc9c0\ub9cc&#8230;. \uc81c\uac00 \uc0ac\uc6a9\ud568\uc5d0 \uc788\uc5b4\uc11c \ubb38\uc81c\uac00 \uc5c6\uae30\uc5d0 \uc18c\uac1c\ud574 \ub4dc\ub9bd\ub2c8\ub2e4. public class StringHelper { \u00a0 \u00a0 static public function trim(str:String, char:String):String { \u00a0 \u00a0 \u00a0 \u00a0 return trimBack(trimFront(str, char), char); \u00a0 \u00a0 } \u00a0 \u00a0 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=1346\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[ActionScript] \ubb38\uc790\uc5f4\uc5d0 \ub300\ud55c Trim \ud568\uc218&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[62],"class_list":["post-1346","post","type-post","status-publish","format-standard","hentry","category-actionscript","tag-actionscript"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1346"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1346\/revisions"}],"predecessor-version":[{"id":3252,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/1346\/revisions\/3252"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1346"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}