{"id":418852,"date":"2021-03-17T17:17:17","date_gmt":"2021-03-17T09:17:17","guid":{"rendered":"http:\/\/4563.org\/?p=418852"},"modified":"2021-03-17T17:17:17","modified_gmt":"2021-03-17T09:17:17","slug":"%e6%80%8e%e4%b9%88%e5%9c%a8%e4%bb%a3%e7%a0%81%e4%b8%ad%e5%af%b9%e5%ad%97%e7%ac%a6%e4%b8%b2%e8%bf%9b%e8%a1%8c%e8%bd%ac%e4%b9%89","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=418852","title":{"rendered":"\u600e\u4e48\u5728\u4ee3\u7801\u4e2d\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u8f6c\u4e49?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u600e\u4e48\u5728\u4ee3\u7801\u4e2d\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u8f6c\u4e49?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yuann72 <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>const text = '\\n' \/\/ \u8f6c\u4e49\u524d\u662f\u4e00\u4e2a\u7531\u548c\u5b57\u6bcd n \u7ec4\u6210\u7684\u957f\u5ea6 2 \u7684\u5b57\u7b26\u4e32 console.assert(text.length === 2) const result = \u8f6c\u4e49(text) \/\/ \u8f6c\u4e49\u540e\u53d8\u6210\u4e00\u4e2a\u6362\u884c\u7b26 console.assert(result.length === 1) console.assert(result.length === 'n')  function \u8f6c\u4e49() {   \/\/ TODO \u4e0d\u4f7f\u7528\u5b57\u7b26\u4e32\u6279\u91cf\u66ff\u6362\u7684\u65b9\u5f0f, \u5982\u4f55\u5b9e\u73b0? js, php, java \u4e2d\u5404\u81ea\u600e\u4e48\u5b9e\u73b0? } <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5583798\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fxplay <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             java&gt;&gt;&gt;StringEscapeUtils \uff1f\uff1f\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5583799\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ipwx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             js: JSON.stringify                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5583800\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yuann72 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @ipwx #2 JSON.stringify \u548c JSON.parse \u90fd\u662f\u76f4\u63a5\u62a5\u9519                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5583801\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cmdOptionKana <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             text.replaceAll(&#8216;\\n&#8217;, &#8216;n&#8217;)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5583802\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hyrious <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             js: eval(&#8216;&#8221;&#8216; + text + &#8216;&#8221;&#8216;) \/\/ \u9003 \/ eval \u6362\u6210 JSON.parse \u5b89\u5168\u70b9<br \/>ruby: &#8220;&#8221;#{text}&#8221;&#8221;.undump                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u600e\u4e48\u5728\u4ee3\u7801\u4e2d\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u8f6c\u4e49? \u8cc7&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/418852"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=418852"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/418852\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=418852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=418852"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=418852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}