{"id":1136,"date":"2016-07-27T14:24:20","date_gmt":"2016-07-27T05:24:20","guid":{"rendered":"http:\/\/blog.box.kr\/?p=1136"},"modified":"2016-07-27T14:24:50","modified_gmt":"2016-07-27T05:24:50","slug":"javascipt-replaceall-%ea%b5%ac%ed%98%84%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=1136","title":{"rendered":"[Javascipt] ReplaceAll \uad6c\ud604\ud558\uae30.."},"content":{"rendered":"<p><strong>function replaceAll(str, searchStr, replaceStr) {<br \/>\n<span id=\"callbacknestoozcokr655414\"><\/span><\/strong><\/p>\n<p><strong>\u00a0\u00a0\u00a0 return str.split(searchStr).join(replaceStr);<br \/>\n}<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>str : \ubb38\uc790\uc5f4 \ub300\uccb4\ub97c \ucc98\ub9ac\ud560 \uc6d0 \ubb38\uc790\uc5f4<\/strong><\/p>\n<p><strong>targetStr : \ub300\uccb4\ud558\uae30 \uc6d0\ud558\ub294 \ubb38\uc790(\uc5f4) &#8211; \ubc14\uafc0 \ubb38\uc790<\/strong><\/p>\n<p><strong>replaceStr : \ub300\uccb4\ub420 \ubb38\uc790(\uc5f4) &#8211; \ubc14\ub00c\uc5b4\uc9c8 \ubb38\uc790<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>* \ub3d9\uc791 \uc6d0\ub9ac<\/strong><\/p>\n<p>split \ud568\uc218\ub97c \ud1b5\ud574 \ubb38\uc790\uc5f4 str\uc744 searchStr(\uad6c\ubd84\uc790)\uc744 \uae30\uc900\uc73c\ub85c\u00a0\ubd84\ub9ac\ud55c\ub2e4.<\/p>\n<p>\uc774 \ub54c, \uad6c\ubd84\uc790\ub294 \ubaa8\ub450 \uc81c\uac70\ub418\uba70, \uad6c\ubd84\uc790\ub97c \uae30\uc900\uc73c\ub85c \ubd84\ub9ac\ub41c \ubb38\uc790\uc5f4\ub4e4\uc774 \ubc30\uc5f4\ub85c \uc800\uc7a5\ub41c\ub2e4.<\/p>\n<p>\ubc30\uc5f4\ub85c \ub098\uc628 \uacb0\uacfc\ub97c \ub2e4\uc2dc\u00a0join \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec searchStr(\uc5f0\uacb0\uc790)\ub85c \uc5f0\uacb0\ud55c\ub2e4.<\/p>\n<p>\uc989,\u00a0replaceAll\ud568\uc218\ub294\u00a0str\ubb38\uc790\uc5f4\uc744 \uad6c\ubd84\uc790(targetStr)\ub85c \ud55c\ubc88 \ubd84\ub9ac[split]\ud558\uc600\ub2e4\uac00\u00a0\uc5f0\uacb0\uc790(replaceStr)\ub97c \ud1b5\ud574 \ub2e4\uc2dc \uc5f0\uacb0(join)\ub41c \uacb0\uacfc \ubb38\uc790\uc5f4\uc744 \ub9ac\ud134\ud55c\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>function replaceAll(str, searchStr, replaceStr) { \u00a0\u00a0\u00a0 return str.split(searchStr).join(replaceStr); } &nbsp; str : \ubb38\uc790\uc5f4 \ub300\uccb4\ub97c \ucc98\ub9ac\ud560 \uc6d0 \ubb38\uc790\uc5f4 targetStr : \ub300\uccb4\ud558\uae30 \uc6d0\ud558\ub294 \ubb38\uc790(\uc5f4) &#8211; \ubc14\uafc0 \ubb38\uc790 replaceStr : \ub300\uccb4\ub420 \ubb38\uc790(\uc5f4) &#8211; \ubc14\ub00c\uc5b4\uc9c8 \ubb38\uc790 &nbsp; &nbsp; * \ub3d9\uc791 \uc6d0\ub9ac split \ud568\uc218\ub97c \ud1b5\ud574 \ubb38\uc790\uc5f4 str\uc744 searchStr(\uad6c\ubd84\uc790)\uc744 \uae30\uc900\uc73c\ub85c\u00a0\ubd84\ub9ac\ud55c\ub2e4. \uc774 \ub54c, \uad6c\ubd84\uc790\ub294 \ubaa8\ub450 \uc81c\uac70\ub418\uba70, \uad6c\ubd84\uc790\ub97c \uae30\uc900\uc73c\ub85c \ubd84\ub9ac\ub41c \ubb38\uc790\uc5f4\ub4e4\uc774 \ubc30\uc5f4\ub85c \uc800\uc7a5\ub41c\ub2e4. \ubc30\uc5f4\ub85c \ub098\uc628 \uacb0\uacfc\ub97c \ub2e4\uc2dc\u00a0join \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec searchStr(\uc5f0\uacb0\uc790)\ub85c \uc5f0\uacb0\ud55c\ub2e4. \uc989,\u00a0replaceAll\ud568\uc218\ub294\u00a0str\ubb38\uc790\uc5f4\uc744 \uad6c\ubd84\uc790(targetStr)\ub85c \ud55c\ubc88 \ubd84\ub9ac[split]\ud558\uc600\ub2e4\uac00\u00a0\uc5f0\uacb0\uc790(replaceStr)\ub97c \ud1b5\ud574 \ub2e4\uc2dc \uc5f0\uacb0(join)\ub41c \uacb0\uacfc \ubb38\uc790\uc5f4\uc744 \ub9ac\ud134\ud55c\ub2e4.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-ik","jetpack-related-posts":[{"id":230,"url":"https:\/\/blog.box.kr\/?p=230","url_meta":{"origin":1136,"position":0},"title":"std::string \ub2e4\ub8e8\uae30.. ( \ucc3e\uae30, \uacf5\ubc31\uc81c\uac70 \ub4f1\ub4f1)","date":"2014-07-23","format":false,"excerpt":"\ubb38\uc790\uc5f4 string #include \"StdAfx.h\" #include \"StringTest.h\" #include <algorithm> \/\/transform \uc0ac\uc6a9 #include <functional> \/\/bind1st using std::string; \/\/ \uc774\ub807\uac8c \uc9c0\uc815\ud574\uc900\ub2e4. StringTest::StringTest() { log(\"StringTest \uc0dd\uc131\uc790 \ud638\ucd9c\"); } StringTest::~StringTest(void) { log(\"StringTest \uc18c\uba78\uc790 \ud638\ucd9c\"); } void StringTest::test() { log(\"============ string class ==========\"); \/\/ \uc0dd\uc131\uc790 \u00a0 std::string s0; \/\/ \ube44\uc5b4\uc788\ub294 string std::string s1(\"012345\",3); \/\/ \uacb0\uacfc: 012\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":799,"url":"https:\/\/blog.box.kr\/?p=799","url_meta":{"origin":1136,"position":1},"title":"[scrap] grep , sed, awk \uc815\uaddc\uc2dd","date":"2015-05-17","format":false,"excerpt":"** grep \ud55c \ub370\uc774\ud130 \uc911 3\ubc88\uc9f8 \ud56d\ubaa9\ub9cc \uac00\uc838 \uc624\uace0 \uc2f6\uc744\ub54c.. grep \".xml\" | awk 'print {$3}' http:\/\/unabated.tistory.com\/447 \uc815\uaddc\uc2dd\uc774\ub780 \ubb34\uc5c7\uc778\uac00 ? \uc5b4\ub5a4 \ubb38\uc790\uc5f4\uc758 \uc9d1\ud569\uc744 \ubb18\uc0ac\ud558\ub294\ub370 \uc0ac\uc6a9\ub418\ub294 \ud14d\uc2a4\ud2b8 \uc2a4\ud2b8\ub9c1 \uc815\ud574\uc9c4 \uad6c\ubb38 \uaddc\uce59\uc5d0 \ub530\ub978\ub2e4 Editor, Utillity, Programming \uc5b8\uc5b4\uc5d0\uc11c \ud14d\uc2a4\ud2b8 \ud328\ud134\uc744 \uae30\uc900\uc73c\ub85c \uac80\uc0c9, \ud639\uc740 \uc870\uc791\ud558\ub294\ub370 \uc0ac\uc6a9\ub41c\ub2e4 \ubcf4\ud1b5 \uc0ac\ub78c\ub4e4\uc774 \uc4f0\ub294 \ud45c\ud604 \uc911\uc5d0\ub3c4 \uadf8\ub300\ub85c \ubb38\uc7a5\uc744 \ud574\uc11d\ud558\uba74\u2026","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":683,"url":"https:\/\/blog.box.kr\/?p=683","url_meta":{"origin":1136,"position":2},"title":"[MariaDB] utf8mb4 \ub780?","date":"2015-04-13","format":false,"excerpt":"http:\/\/blog.lael.be\/post\/917 4\ubc14\uc774\ud2b8 UTF-8 \ubb38\uc790\uc5f4 MySQL\uc5d0\uc11c \ubd80\ub7b4\ubd80\ub7b4 \uc6d0\ub798\uc758 \uc124\uacc4\ub300\ub85c \uac00\ubcc0-4\ubc14\uc774\ud2b8 UTF-8 \ubb38\uc790\uc5f4\uc744 \uc800\uc7a5\ud560 \uc218 \uc788\ub294 \uc790\ub8cc\ud615\uc744 \ucd94\uac00\ud588\ub2e4. 2010\ub144 3\uc6d4 24\uc77c\uc5d0 utf8mb4 \ub77c\ub294 charset\uc744 \ucd94\uac00\ud558\uc600\ub2e4. (MYSQL 5.5.3 \uc5d0 \ucd94\uac00\ub428) (\uad00\ub828 :\u00a0https:\/\/dev.mysql.com\/doc\/relnotes\/mysql\/5.5\/en\/news-5-5-3.html ) > \ubd80\uc5f0\uc124\uba85 : utf8 \uc744 \ud328\uce58\ud558\uc9c0 \uc54a\uace0 \uc2e0\uaddc charset\uc73c\ub85c \ucd94\uac00\ud55c \uc774\uc720\ub294, \uc774\ubbf8 \uad6c\ucd95\ub41c \uc2dc\uc2a4\ud15c\uc5d0 \uc601\ud5a5\uc744 \ubbf8\uce58\uae30 \ub54c\ubb38\uc774\ub2e4. \uc989, \uc774\ubbf8 3\uce78\uc744\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"\u00ec\u008a\u00a4\u00ed\u0081\u00ac\u00eb\u00a6\u00b0\u00ec\u0083\u00b7 2015-03-07 \u00ec\u0098\u00a4\u00ed\u009b\u0084 7.05.17","src":"https:\/\/i0.wp.com\/blog.lael.be\/wp-content\/uploads\/2015\/03\/\u00ec\u008a\u00a4\u00ed\u0081\u00ac\u00eb\u00a6\u00b0\u00ec\u0083\u00b7-2015-03-07-\u00ec\u0098\u00a4\u00ed\u009b\u0084-7.05.17.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":333,"url":"https:\/\/blog.box.kr\/?p=333","url_meta":{"origin":1136,"position":3},"title":"[MFC] &#8211; \ud2b8\ub808\uc774 \uc544\uc774\ucf58 \ub4f1\ub85d \ubc0f \uc708\ub3c4\uc6b0 \uac10\ucd94\uae30","date":"2014-08-09","format":false,"excerpt":"\ucd9c\ucc98 :\u00a0http:\/\/hotangs.tistory.com\/28 \uc708\ub3c4\uc6b0 \uc6b0\uce21 \ud558\ub2e8\uc5d0 \ud2b8\ub808\uc774 \uc544\uc774\ucf58\uc744 \ub4f1\ub85d\ud558\ub294 \ubc29\ubc95\uc774\ub2e4. \uc6b0\uc120 \ud504\ub85c\uc81d\ud2b8\uc5d0 \ud604\uc7ac \ud2b8\ub808\uc774 \uc0c1\ud0dc\ub97c \uc54c\uc218 \uc788\ub294 BOOL \ubcc0\uc218\ub97c \uc120\uc5b8\ud55c\ub2e4. Protected \uc5d0 \uc120\uc5b8 \ubcc0\uc218 \uc774\ub984\uc740 m_bIsTrayIcon \ub85c \ud558\uaca0\ub2e4. \u00a0 \ub2e4\uc74c \ud2b8\ub808\uc774\uc544\uc774\ucf58\uc744 \ub4f1\ub85d\ud558\ub294 \ud568\uc218\ub97c \ub9cc\ub4e0\ub2e4. \ud568\uc218 \uc774\ub984\uc740 RegistTrayIcon \ub85c \ud558\uaca0\ub2e4. Private \ub85c \uc120\uc5b8 \uadf8\ub9ac\uace0 \ucf54\ub529\ud55c\ub2e4. void CTrayDlg::RegistTrayIcon() { NOTIFYICONDATA\u00a0 nid; nid.cbSize =\u2026","rel":"","context":"In &quot;C\/C++&quot;","img":{"alt_text":"\u00ec\u0082\u00ac\u00ec\u009a\u00a9\u00ec\u009e\u0090 \u00ec\u0082\u00bd\u00ec\u009e\u0085 \u00ec\u009d\u00b4\u00eb\u00af\u00b8\u00ec\u00a7\u0080","src":"https:\/\/i0.wp.com\/cfs3.tistory.com\/upload_control\/download.blog?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":164,"url":"https:\/\/blog.box.kr\/?p=164","url_meta":{"origin":1136,"position":4},"title":"\ud504\ub85c\uc138\uc2a4 \uac04\uc758 \ud1b5\uc2e0","date":"2014-07-08","format":false,"excerpt":"\ud504\ub85c\uc138\uc2a4 \uac04\uc758 \ud1b5\uc2e0(IPC)\uc740 \ud504\ub85c\uc138\uc2a4 \uac04\uc5d0 \uc815\ubcf4\ub97c \uc8fc\uace0 \ubc1b\uc744 \uc218 \uc788\ub3c4\ub85d \ud558\ub294 \ud1b5\uc2e0 \uae30\ubc95\uc785\ub2c8\ub2e4. \ud504\ub85c\uc138\uc2a4 \uac04\uc758 \ud1b5\uc2e0 \ubc29\ubc95\uc740 \uc11c\ub85c \uac04\uc5d0 \uba54\uc2dc\uc9c0\ub97c \uc804\ub2ec\ud558\ub294 \ubc29\ubc95\uacfc \uacf5\uc720 \uba54\ubaa8\ub9ac\ub97c \uc774\uc6a9\ud558\ub294 \ubc29\ubc95 \uadf8\ub9ac\uace0 \ud074\ub9bd\ubcf4\ub4dc\ub97c \uc774\uc6a9\ud558\ub294 \ubc29\ubc95 \ub4f1\uc774 \uc788\uc2b5\ub2c8\ub2e4. 1. \ud504\ub85c\uc138\uc2a4 \uc0ac\uc774\uc758 \uba54\uc2dc\uc9c0 \uc804\ub2ec 1)\ub3d9\uc77c\ud55c \ud504\ub85c\uadf8\ub7a8\uc774 \uc5ec\ub7ec \uac1c \uc2e4\ud589 \uc911\uc77c \ub54c \uba54\uc2dc\uc9c0 \uc804\uc1a1 RegisterWindowMessage \uc774\uc6a9 \ud504\ub85c\uc138\uc2a4 \ub610\ub294\u2026","rel":"","context":"In &quot;MFC &amp; WINDOWS&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":687,"url":"https:\/\/blog.box.kr\/?p=687","url_meta":{"origin":1136,"position":5},"title":"[\ud38c]MariaDB \uc124\uc815 \ud30c\uc77c my.cnf","date":"2015-04-13","format":false,"excerpt":"http:\/\/www.programkr.com\/blog\/MUDM5ADMwYT2.html \u00a0 \u00a0 # MariaDB database server configuration file. # # You can copy this file to one of: # - \"\/etc\/mysql\/my.cnf\" to set global options, # - \"~\/.my.cnf\" to set user-specific options. # # One can use all long options that the program supports. # Run program with --help\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/1136"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1136"}],"version-history":[{"count":1,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/1136\/revisions"}],"predecessor-version":[{"id":1138,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/1136\/revisions\/1138"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}