{"id":68325,"date":"2019-06-27T08:47:44","date_gmt":"2019-06-27T00:47:44","guid":{"rendered":"http:\/\/www.xiaoyebailong.com\/?p=68325"},"modified":"2019-06-27T08:47:45","modified_gmt":"2019-06-27T00:47:45","slug":"js%e5%ad%97%e6%af%8d%e5%a4%a7%e5%b0%8f%e5%86%99%e8%bd%ac%e6%8d%a2%e5%ae%9e%e7%8e%b0%e6%96%b9%e6%b3%95%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2019\/06\/27\/68325.htm","title":{"rendered":"js\u5b57\u6bcd\u5927\u5c0f\u5199\u8f6c\u6362\u5b9e\u73b0\u65b9\u6cd5\u603b\u7ed3"},"content":{"rendered":"\n<p><strong>toLocaleUpperCase \u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5176\u4e2d\u6240\u6709\u7684\u5b57\u6bcd\u5b57\u7b26\u90fd\u88ab\u8f6c\u6362\u4e3a\u5927\u5199\uff0c\u540c\u65f6\u9002\u5e94\u5bbf\u4e3b\u73af\u5883\u7684\u5f53\u524d\u533a\u57df\u8bbe\u7f6e\u3002&nbsp;<br>stringVar.tolocaleUpperCase( )<br>\u5fc5\u9009\u7684 stringVar \u5f15\u7528\u662f\u4e00\u4e2a String \u5bf9\u8c61\uff0c\u503c\u6216\u6587\u5b57\u3002<\/p>\n\n\n\n<p><strong>\u8bf4\u660e<br><\/strong>toLocaleUpperCase \u65b9\u6cd5\u8f6c\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\uff0c\u540c\u65f6\u9002\u5e94\u5bbf\u4e3b\u73af\u5883\u7684\u5f53\u524d\u533a\u57df\u8bbe\u7f6e\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5176\u7ed3\u679c\u4e0e\u5229\u7528 toUpperCase \u65b9\u6cd5\u6240\u5f97\u5230\u7684\u7ed3\u679c\u662f\u4e00\u6837\u7684\u3002\u7136\u800c\uff0c\u5982\u679c\u8bed\u8a00\u89c4\u5219\u4e0e\u5e38\u89c4\u7684 Unicode \u5927\u5c0f\u5199\u6620\u5c04\u65b9\u5f0f\u51b2\u7a81\uff0c\u90a3\u4e48\u7ed3\u679c\u5c31\u4f1a\u4e0d\u540c\u3002<\/p>\n\n\n\n<p><strong>toLocaleLowerCase \u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5176\u4e2d\u6240\u6709\u7684\u5b57\u6bcd\u5b57\u7b26\u90fd\u88ab\u8f6c\u6362\u4e3a\u5c0f\u5199\uff0c\u540c\u65f6\u8003\u8651\u5230\u5bbf\u4e3b\u73af\u5883\u7684\u5f53\u524d\u533a\u57df\u8bbe\u7f6e\u3002&nbsp;<br>stringVar.tolocaleLowerCase( )<br>\u5fc5\u9009\u7684 stringVar \u5f15\u7528\u662f\u4e00\u4e2a String \u5bf9\u8c61\uff0c\u503c\u6216\u6587\u5b57\u3002<\/p>\n\n\n\n<p><strong>\u8bf4\u660e<br><\/strong>toLocaleLowerCase \u65b9\u6cd5\u8f6c\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\uff0c\u540c\u65f6\u9002\u5e94\u5bbf\u4e3b\u73af\u5883\u7684\u5f53\u524d\u533a\u57df\u8bbe\u7f6e\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5176\u7ed3\u679c\u4e0e\u5229\u7528 toLowerCase \u65b9\u6cd5\u6240\u5f97\u5230\u7684\u7ed3\u679c\u662f\u4e00\u6837\u7684\u3002\u7136\u800c\uff0c\u5982\u679c\u8bed\u8a00\u89c4\u5219\u4e0e\u5e38\u89c4\u7684 Unicode \u5927\u5c0f\u5199\u6620\u5c04\u65b9\u5f0f\u51b2\u7a81\uff0c\u90a3\u4e48\u7ed3\u679c\u5c31\u4f1a\u4e0d\u540c\u3002<\/p>\n\n\n\n<p><strong>toLowerCase \u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u8be5\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u6bcd\u88ab\u8f6c\u6362\u4e3a\u5c0f\u5199\u5b57\u6bcd\u3002&nbsp;<br>strVariable.toLowerCase( )<br>&#8220;String Literal&#8221;.toLowerCase( )<\/p>\n\n\n\n<p><strong>\u8bf4\u660e<br><\/strong>toLowerCase \u65b9\u6cd5\u5bf9\u975e\u5b57\u6bcd\u5b57\u7b26\u4e0d\u4f1a\u4ea7\u751f\u5f71\u54cd\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u7684\u793a\u4f8b\u6f14\u793a\u4e86 of the toLowerCase \u65b9\u6cd5\u7684\u6548\u679c\uff1a&nbsp;<br>var strVariable = &#8220;This is a STRING object&#8221;;<br>strVariable = strVariable.toLowerCase( );<\/p>\n\n\n\n<p>\u5728\u6267\u884c\u4e0a\u4e00\u6761\u8bed\u53e5\u540e strVariable \u7684\u503c\u4e3a\uff1a&nbsp;<br>this is a string object<\/p>\n\n\n\n<p><strong>toUpperCase \u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u8be5\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5b57\u6bcd\u90fd\u88ab\u8f6c\u5316\u4e3a\u5927\u5199\u5b57\u6bcd \u3002<br>strVariable.toUpperCase( )<br>&#8220;String Literal&#8221;.toUpperCase( )<\/p>\n\n\n\n<p><strong>\u8bf4\u660e<br><\/strong>toUpperCase \u65b9\u6cd5\u5bf9\u975e\u5b57\u6bcd\u5b57\u7b26\u4e0d\u4f1a\u4ea7\u751f\u5f71\u54cd\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b<br><\/strong>\u4e0b\u9762\u7684\u793a\u4f8b\u6f14\u793a\u4e86 toUpperCase \u65b9\u6cd5\u7684\u6548\u679c\uff1a&nbsp;<br>var strVariable = &#8220;This is a STRING object&#8221;;<br>strVariable = strVariable.toUpperCase( );<\/p>\n\n\n\n<p>\u5728\u6267\u884c\u4e0a\u4e00\u6761\u8bed\u53e5\u540e strVariable \u7684\u503c\u4e3a\uff1a&nbsp;<br>THIS IS A STRING OBJECT<br><a>\u590d\u5236\u4ee3\u7801<\/a>\u4ee3\u7801\u5982\u4e0b:<br>function UpperFirstLetter(str)&nbsp;&nbsp;&nbsp;<br>{&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; return str.replace(\/\/b\/w+\/b\/g, function(word) {&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return word.substring(0,1).toUpperCase( ) +&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; word.substring(1);&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>}&nbsp;&nbsp;\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>toLocaleUpperCase \u65b9\u6cd5 \u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5176\u4e2d\u6240\u6709\u7684\u5b57\u6bcd\u5b57\u7b26\u90fd\u88ab\u8f6c\u6362\u4e3a\u5927\u5199\uff0c\u540c\u65f6\u9002\u5e94\u5bbf\u4e3b\u73af\u5883\u7684\u5f53\u524d\u533a\u57df\u8bbe\u7f6e\u3002&nbsp;stringVar.tolocaleUpperCase( )\u5fc5\u9009\u7684 stringVar \u5f15\u7528\u662f\u4e00\u4e2a St&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-68325","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/68325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=68325"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/68325\/revisions"}],"predecessor-version":[{"id":68326,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/68325\/revisions\/68326"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=68325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=68325"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=68325"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=68325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}