{"id":355,"date":"2020-02-04T23:01:02","date_gmt":"2020-02-04T15:01:02","guid":{"rendered":"https:\/\/blog.cqdefxxx.com\/?p=355"},"modified":"2020-02-04T23:01:02","modified_gmt":"2020-02-04T15:01:02","slug":"%e5%ad%97%e7%ac%a6%e4%b8%b2%e7%9a%84%e7%9b%b8%e5%85%b3%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.viter.top\/index.php\/2020\/02\/04\/%e5%ad%97%e7%ac%a6%e4%b8%b2%e7%9a%84%e7%9b%b8%e5%85%b3%e6%96%b9%e6%b3%95\/","title":{"rendered":"\u5b57\u7b26\u4e32\u7684\u76f8\u5173\u65b9\u6cd5"},"content":{"rendered":"<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\/\/\u521b\u5efa\u4e00\u4e2a\u5b57\u7b26\u4e32\n\t\t\tvar str = \"Hello Atguigu\";\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u5728\u5e95\u5c42\u5b57\u7b26\u4e32\u662f\u4ee5\u5b57\u7b26\u6570\u7ec4\u7684\u5f62\u5f0f\u4fdd\u5b58\u7684\n\t\t\t * [\"H\",\"e\",\"l\"]\n\t\t\t *\/\n\t\t\t\n\t\t\t\/*\n\t\t\t * length\u5c5e\u6027\n\t\t\t * \t- \u53ef\u4ee5\u7528\u6765\u83b7\u53d6\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\n\t\t\t *\/\n\t\t\t\/\/console.log(str.length);\n\t\t\t\/\/console.log(str[5]);\n\t\t\t\n\t\t\t\/*\n\t\t\t * charAt()\n\t\t\t * \t- \u53ef\u4ee5\u8fd4\u56de\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u4f4d\u7f6e\u7684\u5b57\u7b26\n\t\t\t * \t- \u6839\u636e\u7d22\u5f15\u83b7\u53d6\u6307\u5b9a\u7684\u5b57\u7b26\t\n\t\t\t *\/\n\t\t\tstr = \"\u4e2dHello Atguigu\";\n\t\t\t\n\t\t\tvar result = str.charAt(6);\n\t\t\t\n\t\t\t\/*\n\t\t\t * charCodeAt()\n\t\t\t * \t- \u83b7\u53d6\u6307\u5b9a\u4f4d\u7f6e\u5b57\u7b26\u7684\u5b57\u7b26\u7f16\u7801\uff08Unicode\u7f16\u7801\uff09\n\t\t\t *\/\n\t\t\t\n\t\t\tresult = str.charCodeAt(0);\n\t\t\t\n\t\t\t\/*\n\t\t\t * String.formCharCode()\n\t\t\t * \t- \u53ef\u4ee5\u6839\u636e\u5b57\u7b26\u7f16\u7801\u53bb\u83b7\u53d6\u5b57\u7b26\n\t\t\t *\/\n\t\t\tresult = String.fromCharCode(0x2692);\n\t\t\t\n\t\t\t\/*\n\t\t\t * concat()\n\t\t\t * \t- \u53ef\u4ee5\u7528\u6765\u8fde\u63a5\u4e24\u4e2a\u6216\u591a\u4e2a\u5b57\u7b26\u4e32\n\t\t\t * \t- \u4f5c\u7528\u548c+\u4e00\u6837\n\t\t\t *\/\n\t\t\tresult = str.concat(\"\u4f60\u597d\",\"\u518d\u89c1\");\n\t\t\t\n\t\t\t\/*\n\t\t\t * indexof()\n\t\t\t * \t- \u8be5\u65b9\u6cd5\u53ef\u4ee5\u68c0\u7d22\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709\u6307\u5b9a\u5185\u5bb9\n\t\t\t * \t- \u5982\u679c\u5b57\u7b26\u4e32\u4e2d\u542b\u6709\u8be5\u5185\u5bb9\uff0c\u5219\u4f1a\u8fd4\u56de\u5176\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u7d22\u5f15\n\t\t\t * \t\t\u5982\u679c\u6ca1\u6709\u627e\u5230\u6307\u5b9a\u7684\u5185\u5bb9\uff0c\u5219\u8fd4\u56de-1\n\t\t\t * \t- \u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff0c\u6307\u5b9a\u5f00\u59cb\u67e5\u627e\u7684\u4f4d\u7f6e\n\t\t\t * \n\t\t\t * lastIndexOf();\n\t\t\t * \t- \u8be5\u65b9\u6cd5\u7684\u7528\u6cd5\u548cindexOf()\u4e00\u6837\uff0c\n\t\t\t * \t\t\u4e0d\u540c\u7684\u662findexOf\u662f\u4ece\u524d\u5f80\u540e\u627e\uff0c\n\t\t\t * \t\t\u800clastIndexOf\u662f\u4ece\u540e\u5f80\u524d\u627e\n\t\t\t * \t- \u4e5f\u53ef\u4ee5\u6307\u5b9a\u5f00\u59cb\u67e5\u627e\u7684\u4f4d\u7f6e\n\t\t\t *\/\n\t\t\t\n\t\t\tstr = \"hello hatguigu\";\n\t\t\t\n\t\t\tresult = str.indexOf(\"h\",1);\n\t\t\t\n\t\t\tresult = str.lastIndexOf(\"h\",5);\n\t\t\t\n\t\t\t\/*\n\t\t\t * slice()\n\t\t\t * \t- \u53ef\u4ee5\u4ece\u5b57\u7b26\u4e32\u4e2d\u622a\u53d6\u6307\u5b9a\u7684\u5185\u5bb9\n\t\t\t * \t- \u4e0d\u4f1a\u5f71\u54cd\u539f\u5b57\u7b26\u4e32\uff0c\u800c\u662f\u5c06\u622a\u53d6\u5230\u5185\u5bb9\u8fd4\u56de\n\t\t\t * \t- \u53c2\u6570\uff1a\n\t\t\t * \t\t\u7b2c\u4e00\u4e2a\uff0c\u5f00\u59cb\u4f4d\u7f6e\u7684\u7d22\u5f15\uff08\u5305\u62ec\u5f00\u59cb\u4f4d\u7f6e\uff09\n\t\t\t * \t\t\u7b2c\u4e8c\u4e2a\uff0c\u7ed3\u675f\u4f4d\u7f6e\u7684\u7d22\u5f15\uff08\u4e0d\u5305\u62ec\u7ed3\u675f\u4f4d\u7f6e\uff09\n\t\t\t * \t\t\t- \u5982\u679c\u7701\u7565\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff0c\u5219\u4f1a\u622a\u53d6\u5230\u540e\u8fb9\u6240\u6709\u7684\n\t\t\t * \t\t- \u4e5f\u53ef\u4ee5\u4f20\u9012\u4e00\u4e2a\u8d1f\u6570\u4f5c\u4e3a\u53c2\u6570\uff0c\u8d1f\u6570\u7684\u8bdd\u5c06\u4f1a\u4ece\u540e\u8fb9\u8ba1\u7b97\n\t\t\t *\/\n\t\t\tstr = \"abcdefghijk\";\n\t\t\t\n\t\t\tresult = str.slice(1,4);\n\t\t\tresult = str.slice(1,-1);\n\t\t\t\n\t\t\t\/*\n\t\t\t * substring()\n\t\t\t * \t- \u53ef\u4ee5\u7528\u6765\u622a\u53d6\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5slice()\u7c7b\u4f3c\n\t\t\t * \t- \u53c2\u6570\uff1a\n\t\t\t * \t\t- \u7b2c\u4e00\u4e2a\uff1a\u5f00\u59cb\u622a\u53d6\u4f4d\u7f6e\u7684\u7d22\u5f15\uff08\u5305\u62ec\u5f00\u59cb\u4f4d\u7f6e\uff09\n\t\t\t * \t\t- \u7b2c\u4e8c\u4e2a\uff1a\u7ed3\u675f\u4f4d\u7f6e\u7684\u7d22\u5f15\uff08\u4e0d\u5305\u62ec\u7ed3\u675f\u4f4d\u7f6e\uff09\n\t\t\t * \t\t- \u4e0d\u540c\u7684\u662f\u8fd9\u4e2a\u65b9\u6cd5\u4e0d\u80fd\u63a5\u53d7\u8d1f\u503c\u4f5c\u4e3a\u53c2\u6570\uff0c\n\t\t\t * \t\t\t\u5982\u679c\u4f20\u9012\u4e86\u4e00\u4e2a\u8d1f\u503c\uff0c\u5219\u9ed8\u8ba4\u4f7f\u75280\n\t\t\t * \t\t- \u800c\u4e14\u4ed6\u8fd8\u81ea\u52a8\u8c03\u6574\u53c2\u6570\u7684\u4f4d\u7f6e\uff0c\u5982\u679c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u5c0f\u4e8e\u7b2c\u4e00\u4e2a\uff0c\u5219\u81ea\u52a8\u4ea4\u6362\n\t\t\t *\/\n\t\t\t\n\t\t\tresult = str.substring(0,1);\n\t\t\t\n\t\t\t\/*\n\t\t\t * substr()\n\t\t\t * \t- \u7528\u6765\u622a\u53d6\u5b57\u7b26\u4e32\n\t\t\t * \t- \u53c2\u6570\uff1a\n\t\t\t * \t\t1.\u622a\u53d6\u5f00\u59cb\u4f4d\u7f6e\u7684\u7d22\u5f15\n\t\t\t * \t\t2.\u622a\u53d6\u7684\u957f\u5ea6\n\t\t\t *\/\n\t\t\t\n\t\t\tstr = \"abcdefg\";\n\t\t\t\n\t\t\tresult = str.substr(3,2);\n\t\t\t\n\t\t\t\/*\n\t\t\t * split()\n\t\t\t * \t- \u53ef\u4ee5\u5c06\u4e00\u4e2a\u5b57\u7b26\u4e32\u62c6\u5206\u4e3a\u4e00\u4e2a\u6570\u7ec4\n\t\t\t * \t- \u53c2\u6570\uff1a\n\t\t\t * \t\t-\u9700\u8981\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f5c\u4e3a\u53c2\u6570\uff0c\u5c06\u4f1a\u6839\u636e\u8be5\u5b57\u7b26\u4e32\u53bb\u62c6\u5206\u6570\u7ec4\n\t\t\t *\/\n\t\t\tstr = \"abcbcdefghij\";\n\t\t\t\n\t\t\tresult = str.split(\"d\");\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u5982\u679c\u4f20\u9012\u4e00\u4e2a\u7a7a\u4e32\u4f5c\u4e3a\u53c2\u6570\uff0c\u5219\u4f1a\u5c06\u6bcf\u4e2a\u5b57\u7b26\u90fd\u62c6\u5206\u4e3a\u6570\u7ec4\u4e2d\u7684\u4e00\u4e2a\u5143\u7d20\n\t\t\t *\/\n\t\t\tresult = str.split(\"\");\n\t\t\t\n\t\t\t\/\/console.log(Array.isArray(result));\n\t\t\t\/\/console.log(result[0]);\n\t\t\tconsole.log(result);\n\t\t\t\n\t\t\t\n\t\t\tstr = \"abcdefg\";\n\t\t\t\n\t\t\t\/*\n\t\t\t * toUpperCase()\n\t\t\t * \t- \u5c06\u4e00\u4e2a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5927\u5199\u5e76\u8fd4\u56de\n\t\t\t *\/\n\t\t\tresult = str.toUpperCase();\n\t\t\t\n\t\t\tstr = \"ABCDEFG\";\n\t\t\t\n\t\t\t\/*\n\t\t\t * toLowerCase()\n\t\t\t * \t-\u5c06\u4e00\u4e2a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5c0f\u5199\u5e76\u8fd4\u56de\n\t\t\t *\/\n\t\t\tresult = str.toLowerCase();\n\t\t\t\n\t\t\t\/\/console.log(result);\n\t\t\t\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset= &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[4],"_links":{"self":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/355"}],"collection":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/comments?post=355"}],"version-history":[{"count":0,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/355\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/media?parent=355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/categories?post=355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/tags?post=355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}