{"id":33340,"date":"2024-11-25T14:01:53","date_gmt":"2024-11-25T06:01:53","guid":{"rendered":"https:\/\/fwq.ai\/blog\/33340\/"},"modified":"2024-11-25T14:01:53","modified_gmt":"2024-11-25T06:01:53","slug":"%e5%b0%8f%e7%a8%8b%e5%ba%8f%e4%b9%8b%e5%ad%97%e7%ac%a6%e4%b8%b2%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/33340\/","title":{"rendered":"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528"},"content":{"rendered":"<p>\u5b57\u7b26\u4e32\u6216\u4e32(string)\u662f\u7531\u6570\u5b57\u3001\u5b57\u6bcd\u3001\u4e0b\u5212\u7ebf\u7ec4\u6210\u7684\u4e00\u4e32\u5b57\u7b26\u3002\u4e00\u5b83\u662f\u7f16\u7a0b\u8bed\u8a00\u4e2d\u8868\u793a\u6587\u672c\u7684\u6570\u636e\u7c7b\u578b\u3002\u5728\u7a0b\u5e8f\u8bbe\u8ba1\u4e2d\uff0c\u5b57\u7b26\u4e32\uff08string\uff09\u4e3a\u7b26\u53f7\u6216\u6570\u503c\u7684\u4e00\u4e2a\u8fde\u7eed\u5e8f\u5217\uff0c\u5982\u7b26\u53f7\u4e32\uff08\u4e00\u4e32\u5b57\u7b26\uff09\u6216\u4e8c\u8fdb\u5236\u6570\u5b57\u4e32\uff08\u4e00\u4e32\u4e8c\u8fdb\u5236\u6570\u5b57\uff09\u3002<\/p>\n<p>\u901a\u5e38\u4ee5\u4e32\u7684\u6574\u4f53\u4f5c\u4e3a\u64cd\u4f5c\u5bf9\u8c61\uff0c\u5982\uff1a\u5728\u4e32\u4e2d\u67e5\u627e\u67d0\u4e2a\u5b50\u4e32\u3001\u6c42\u53d6\u4e00\u4e2a\u5b50\u4e32\u3001\u5728\u4e32\u7684\u67d0\u4e2a\u4f4d\u7f6e\u4e0a\u63d2\u5165\u4e00\u4e2a\u5b50\u4e32\u4ee5\u53ca\u5220\u9664\u4e00\u4e2a\u5b50\u4e32\u7b49\u3002\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d,<strong>string<\/strong>\u5b57\u7b26\u4e32\u53ef\u7528&#8221;\u6216&#8221;&#8221;\u58f0\u660e\uff0c\u53ef\u7528length\u5c5e\u6027\u83b7\u53d6\u957f\u5ea6\u3002\u5e38\u7528\u65b9\u6cd5\u53ef\u5206\u4e3a\u67e5\u627e\u3001\u622a\u53d6\u548c\u8f6c\u6362\u3002<\/p>\n<h3><strong><span style=\"font-size: 14px\">1&nbsp;\u67e5\u627e<\/span><\/strong><\/h3>\n<p>charAt(index) :&nbsp;\u83b7\u53d6\u6307\u5b9a\u4f4d\u7f6e\u7684\u5b57\u7b26\uff08\u4e0b\u6807index\u4ece0\u5f00\u59cb\uff09;<\/p>\n<p>charCodeAt(index) :&nbsp;\u83b7\u6307\u5b9a\u7684\u4f4d\u7f6e\u7684\u5b57\u7b26\u7684Unicode\u7f16\u7801\uff08\u4e0b\u6807index\u4ece0\u5f00\u59cb\uff09;<\/p>\n<p>indexOf(searchvalue,start):&nbsp;\u4ece\u5b57\u7b26\u4e32\u5f00\u5934\u5411\u540e\u641c\u7d22\u5b50\u5b57\u7b26\u4e32,\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u8fd4\u56de-1;&nbsp;searchvalue\u4e3a\u9700\u68c0\u7d22\u7684\u5b57\u7b26\u4e32\u503c,&nbsp;start\u4e3a\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9ed8\u8ba4\u4e3a0\u3002<\/p>\n<p>lastIndexOf(searchvalue,start):\u4ece\u5b57\u7b26\u4e32\u5c3e\u5411\u524d\u5f00\u59cb\u641c\u7d22\u5b50\u5b57\u7b26\u4e32,\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u8fd4\u56de-1; searchvalue\u4e3a\u9700\u68c0\u7d22\u7684\u5b57\u7b26\u4e32\u503c,start\u4e3a\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9ed8\u8ba4\u4e3a\u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u5904\u3002<\/p>\n<p>localeCompare(target):&nbsp;\u7528\u672c\u5730\u7279\u5b9a\u7684\u987a\u5e8f\u6765\u6bd4\u8f83\u4e24\u4e2a\u5b57\u7b26\u4e32;<\/p>\n<p>match(regexp):&nbsp;\u5b58\u653e\u5339\u914d\u7ed3\u679c\u7684\u6570\u7ec4;<\/p>\n<p>search(searchvalue):&nbsp;\u6307\u5b9a\u67e5\u627e\u7684\u5b57\u7b26\u4e32\u7684\u8d77\u59cb\u4f4d\u7f6e;&nbsp;searchvalue\u4e3a\u67e5\u627e\u7684\u5b57\u7b26\u4e32\u6216\u8005\u6b63\u5219\u8868\u8fbe\u5f0f\u3002<\/p>\n<pre>Page({  \/\/\u5b57\u7b26\u4e32\u67e5\u627e\u65b9\u6cd5\u4f8b\u5b50\n  onLoad: function(options) {\n    let str = '\u6211\u4e0d\u662f\u7a0b\u5e8f\uff0c\u6211\u662f\u7801\u519c\u3002';\n    let at = str.charAt(3);\n    let codeAt = str.charCodeAt(1);\n    console.log('\u5b57\u7b26\u4e32:%s', str);\n    console.log('charAt(3)=%s, charCodeAt(1)=%s', at, codeAt);\n    let i = str.indexOf(\"\u7801\u519c\");\n    let l = str.lastIndexOf(\"\u7a0b\u5e8f\");\n    console.log('indexOf=%d,lastIndexOf=%d', i, l);\n    let c = str.localeCompare('\u7a0b\u5e8f');\n    let m = str.match('\u7a0b\u5e8f', '\u7801\u519c');\n    console.log('localeCompare=%s,match=%s', c, m)\n    let s = str.search('\u7a0b\u5e8f');\n    console.log('search=%s', s)\n  }\n})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/051\/5fce990058e328c28c3dbbdef10822ea-0.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe\" alt=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe\" \/><\/p>\n<h3><strong><span style=\"font-size: 14px\">2&nbsp;\u622a\u53d6<\/span><\/strong><\/h3>\n<p>slice(start,end):&nbsp;\u63d0\u53d6\u5b57\u7b26\u4e32\u7684\u67d0\u4e2a\u90e8\u5206\uff0c\u5e76\u4ee5\u65b0\u7684\u5b57\u7b26\u4e32\u8fd4\u56de\u88ab\u63d0\u53d6\u7684\u90e8\u5206\u3002Start\u4e3a\u5fc5\u586b\u9879\uff0c\u8981\u62bd\u53d6\u7684\u7247\u65ad\u7684\u8d77\u59cb\u4e0b\u6807\uff0c\u7b2c\u4e00\u4e2a\u5b57\u7b26\u4f4d\u7f6e\u4e3a&nbsp;0\u3002end\u4e3a\u53ef\u9009\u9879\uff0c\u7d27\u63a5\u7740\u8981\u62bd\u53d6\u7684\u7247\u6bb5\u7684\u7ed3\u5c3e\u7684\u4e0b\u6807\u3002<\/p>\n<p>split(separator,limit):&nbsp;separator\u5b57\u7b26\u4e32\u6216\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u4e3a\u53ef\u9009\u9879\u3002limit\u53ef\u9009\uff0c\u9ed8\u8ba4\u4e3a\u6570\u7ec4\u7684\u6700\u5927\u957f\u5ea6\u3002<\/p>\n<p>substring(from,to):&nbsp;from\u5fc5\u586b\u9879\uff0c\u6b63\u6574\u6570\uff0c\u89c4\u5b9a\u8981\u63d0\u53d6\u7684\u5b50\u4e32\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\u3002to\u53ef\u9009\u3002\u6b63\u6574\u6570\uff0c\u9ed8\u8ba4\u90a3\u4e48\u8fd4\u56de\u7684\u5b50\u4e32\u4f1a\u4e00\u76f4\u5230\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\u3002<\/p>\n<pre>Page({  \/\/\u5b57\u7b26\u4e32\u622a\u53d6\u4f8b\u5b50\n  onLoad: function(options) {\n    let str = '\u4e0d\u4f1a\u7f16\u7801\u7684\u4eba,\u4e5f\u80fd\u79f0\u7801\u519c?';\n    let s = str.slice(2, 4);\n    console.log('\u5b57\u7b26\u4e32=%s', str);\n    console.log('str.slice(2,4)=%s', s);\n    let a = str.split(',');\n    console.log('str.split(,)=%s', a);\n    let sb = str.substring(1,2);\n    console.log('substring(1,2)=%s', sb);\n  }\n})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/051\/8b0c2f878dc40d9ac430f99c2574ef17-1.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe1\" alt=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe1\" \/><\/p>\n<h3><strong><span style=\"font-size: 14px\">3&nbsp;\u8f6c\u6362<\/span><\/strong><\/h3>\n<p>toString()\u65b9\u6cd5\uff1b\u6570\u503c\u3001\u5b57\u7b26\u4e32\u3001\u5bf9\u8c61\u3001\u5e03\u5c14\uff1b\u90fd\u6709toString\u65b9\u6cd5\uff1b\u8fd9\u4e2a\u65b9\u6cd5\u552f\u4e00\u80fd\u505a\u7684\u5c31\u662f\u8fd4\u56de\u76f8\u5e94\u7684\u5b57\u7b26\u4e32\uff1b\u5176\u4e2dnull\u548cundefined\u6ca1\u6709toString()\u65b9\u6cd5\uff1b<\/p>\n<p>String()\u5c5e\u4e8e\u5f3a\u5236\u8f6c\u6362\uff0c&nbsp;null\u8f6c\u6362\u7684\u7ed3\u679c\u4e3anull\uff1bundefined\u8f6c\u6362\u7684\u7ed3\u679c\u4e3aundefined\uff1b\u5176\u4f59\u7684\u5982\u679c\u6709toString()\u65b9\u6cd5\uff0c\u5373\u8c03\u7528\u8be5\u65b9\u6cd5\u5e76\u8fd4\u56de\u76f8\u5e94\u7684\u7ed3\u679c\uff1b<\/p>\n<p>valueOf:&nbsp;\u8fd4\u56deString\u5bf9\u8c61\u7684\u539f\u59cb\u503c,&nbsp;\u9690\u5f0f\u8c03\u7528;<\/p>\n<p>String.fromCharCode(n1,&nbsp;n2, &#8230;,&nbsp;nX):&nbsp;\u5c06&nbsp;Unicode&nbsp;\u7f16\u7801\u8f6c\u4e3a\u4e00\u4e2a\u5b57\u7b26\uff1b<\/p>\n<p>toLowerCase:&nbsp;\u7528\u4e8e\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5c0f\u5199\uff1b<\/p>\n<p>toLocaleLowerCase:&nbsp;\u4e0e&nbsp;toLowerCase()&nbsp;\u4e0d\u540c\u7684\u662f\uff0ctoLocaleLowerCase()&nbsp;\u65b9\u6cd5\u6309\u7167\u672c\u5730\u65b9\u5f0f\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5c0f\u5199\u3002\u53ea\u6709\u51e0\u79cd\u8bed\u8a00\uff08\u5982\u571f\u8033\u5176\u8bed\uff09\u5177\u6709\u5730\u65b9\u7279\u6709\u7684\u5927\u5c0f\u5199\u6620\u5c04\uff0c\u6240\u6709\u8be5\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u901a\u5e38\u4e0e&nbsp;toLowerCase()&nbsp;\u4e00\u6837\u3002<\/p>\n<p>toUpperCase:&nbsp;\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5927\u5199\u3002<\/p>\n<p>toLocaleUpperCase:&nbsp;\u4e0e&nbsp;toUpperCase()&nbsp;\u4e0d\u540c\u7684\u662f\uff0ctoLocaleUpperCase()&nbsp;\u65b9\u6cd5\u6309\u7167\u672c\u5730\u65b9\u5f0f\u628a\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3a\u5927\u5199\u3002\u53ea\u6709\u51e0\u79cd\u8bed\u8a00\uff08\u5982\u571f\u8033\u5176\u8bed\uff09\u5177\u6709\u5730\u65b9\u7279\u6709\u7684\u5927\u5c0f\u5199\u6620\u5c04\uff0c\u6240\u6709\u8be5\u65b9\u6cd5\u7684\u8fd4\u56de\u503c\u901a\u5e38\u4e0e&nbsp;toUpperCase()&nbsp;\u4e00\u6837\u3002<\/p>\n<pre>Page({  \/\/\u5b57\u7b26\u4e32\u8f6c\u6362\u4f8b\u5b50\n  onLoad: function(options) {\n    let str = \"i love Programming.\";\n    let v = str.valueOf();\n    console.log('\u5b57\u7b26\u4e32=%s', str);\n    console.log('valueOf=%s', v);\n    let l = str.toLowerCase();\n    let u = str.toUpperCase();\n    console.log('toLowerCase=%s,toUpperCase=%s', l, u);\n    let f = String.fromCharCode('30721', '20892');\n    console.log('fromCharCode=%s', f);\n  }\n})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/051\/602560d758908918e66aed252e64d407-2.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe2\" alt=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe2\" \/><\/p>\n<h3><strong><span style=\"font-size: 14px\">4&nbsp;\u5176\u4ed6<\/span><\/strong><\/h3>\n<p>concat(<em>string1<\/em>, &#8230;,&nbsp;<em>stringX<\/em>):&nbsp;\u8fde\u63a5\u4e24\u4e2a\u6216\u66f4\u591a\u5b57\u7b26\u4e32\uff0c\u5e76\u8fd4\u56de\u65b0\u7684\u5b57\u7b26\u4e32\uff1b<\/p>\n<p>trim:&nbsp;\u53bb\u9664\u5b57\u7b26\u4e32\u4e24\u8fb9\u7684\u7a7a\u767d\uff1b<\/p>\n<p>replace(searchvalue,newvalue):&nbsp;&nbsp;\u5728\u5b57\u7b26\u4e32\u4e2d\u67e5\u627e\u5339\u914d\u7684\u5b50\u4e32\uff0c \u5e76\u66ff\u6362\u4e0e\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u7684\u5b50\u4e32\u3002<\/p>\n<pre>Page({  \/\/\u5b57\u7b26\u4e32\u5176\u4ed6\u65b9\u6cd5\u4f8b\u5b50\n  onLoad: function(options) {\n    let str = \" \u6211\u662f\u7a0b\u5e8f\u733f\";\n    let c = str.concat(',','\u6211\u559c\u6b22\u542c\u6b4c.');\n    let t = c.trim();\n    console.log('concat=%s', c);\n    console.log('trim=%s', t);\n    let r = t.replace(\/\u6211\/g,'\u4f60');\n    console.log('replace=%s',r);\n  }\n})<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/051\/602560d758908918e66aed252e64d407-3.png\" class=\"aligncenter\" title=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe3\" alt=\"\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u63d2\u56fe3\" \/><\/p>\n<p>\u63a8\u8350\u6559\u7a0b\uff1a\u300a\u300b<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5c0f\u7a0b\u5e8f\u4e4b\u5b57\u7b26\u4e32\u7684\u4f7f\u7528\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b57\u7b26\u4e32\u6216\u4e32(string)\u662f\u7531\u6570\u5b57\u3001\u5b57\u6bcd\u3001\u4e0b\u5212\u7ebf\u7ec4\u6210\u7684\u4e00\u4e32\u5b57\u7b26\u3002\u4e00\u5b83\u662f\u7f16\u7a0b\u8bed\u8a00\u4e2d\u8868\u793a\u6587\u672c\u7684\u6570\u636e\u7c7b\u578b\u3002\u5728\u7a0b\u5e8f\u8bbe\u8ba1\u4e2d\uff0c\u5b57\u7b26\u4e32\uff08string\uff09\u4e3a\u7b26\u53f7\u6216\u6570\u503c\u7684\u4e00\u4e2a\u8fde\u7eed\u5e8f\u5217\uff0c\u5982\u7b26\u53f7\u4e32\uff08\u4e00\u4e32\u5b57\u7b26\uff09\u6216\u4e8c\u8fdb\u5236\u6570\u5b57\u4e32\uff08\u4e00\u4e32\u4e8c\u8fdb\u5236\u6570\u5b57\uff09\u3002 \u901a\u5e38\u4ee5\u4e32\u7684\u6574\u4f53\u4f5c\u4e3a\u64cd\u4f5c\u5bf9\u8c61\uff0c\u5982\uff1a\u5728\u4e32\u4e2d\u67e5\u627e\u67d0\u4e2a\u5b50\u4e32\u3001\u6c42\u53d6\u4e00\u4e2a\u5b50\u4e32\u3001\u5728\u4e32\u7684\u67d0\u4e2a\u4f4d\u7f6e\u4e0a\u63d2\u5165\u4e00\u4e2a\u5b50\u4e32\u4ee5\u53ca\u5220\u9664\u4e00\u4e2a\u5b50\u4e32\u7b49\u3002\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u4e2d,string\u5b57\u7b26\u4e32\u53ef\u7528&#8221;\u6216&#8221;&#8221;\u58f0\u660e\uff0c\u53ef\u7528length\u5c5e\u6027\u83b7\u53d6\u957f\u5ea6\u3002\u5e38\u7528\u65b9\u6cd5\u53ef\u5206\u4e3a\u67e5\u627e\u3001\u622a\u53d6\u548c\u8f6c\u6362\u3002 1&nbsp;\u67e5\u627e charAt(index) :&nbsp;\u83b7\u53d6\u6307\u5b9a\u4f4d\u7f6e\u7684\u5b57\u7b26\uff08\u4e0b\u6807index\u4ece0\u5f00\u59cb\uff09; charCodeAt(index) :&nbsp;\u83b7\u6307\u5b9a\u7684\u4f4d\u7f6e\u7684\u5b57\u7b26\u7684Unicode\u7f16\u7801\uff08\u4e0b\u6807index\u4ece0\u5f00\u59cb\uff09; indexOf(searchvalue,start):&nbsp;\u4ece\u5b57\u7b26\u4e32\u5f00\u5934\u5411\u540e\u641c\u7d22\u5b50\u5b57\u7b26\u4e32,\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u8fd4\u56de-1;&nbsp;searchvalue\u4e3a\u9700\u68c0\u7d22\u7684\u5b57\u7b26\u4e32\u503c,&nbsp;start\u4e3a\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9ed8\u8ba4\u4e3a0\u3002 lastIndexOf(searchvalue,start):\u4ece\u5b57\u7b26\u4e32\u5c3e\u5411\u524d\u5f00\u59cb\u641c\u7d22\u5b50\u5b57\u7b26\u4e32,\u6ca1\u6709\u627e\u5230\u5339\u914d\u7684\u8fd4\u56de-1; searchvalue\u4e3a\u9700\u68c0\u7d22\u7684\u5b57\u7b26\u4e32\u503c,start\u4e3a\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9ed8\u8ba4\u4e3a\u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u5904\u3002 localeCompare(target):&nbsp;\u7528\u672c\u5730\u7279\u5b9a\u7684\u987a\u5e8f\u6765\u6bd4\u8f83\u4e24\u4e2a\u5b57\u7b26\u4e32; match(regexp):&nbsp;\u5b58\u653e\u5339\u914d\u7ed3\u679c\u7684\u6570\u7ec4; search(searchvalue):&nbsp;\u6307\u5b9a\u67e5\u627e\u7684\u5b57\u7b26\u4e32\u7684\u8d77\u59cb\u4f4d\u7f6e;&nbsp;searchvalue\u4e3a\u67e5\u627e\u7684\u5b57\u7b26\u4e32\u6216\u8005\u6b63\u5219\u8868\u8fbe\u5f0f\u3002 Page({ \/\/\u5b57\u7b26\u4e32\u67e5\u627e\u65b9\u6cd5\u4f8b\u5b50 onLoad: function(options) { let str = &#8216;\u6211\u4e0d\u662f\u7a0b\u5e8f\uff0c\u6211\u662f\u7801\u519c\u3002&#8217;; let at = str.charAt(3); let codeAt = str.charCodeAt(1); console.log(&#8216;\u5b57\u7b26\u4e32:%s&#8217;, str); console.log(&#8216;charAt(3)=%s, charCodeAt(1)=%s&#8217;, at, codeAt); let i = str.indexOf(&#8220;\u7801\u519c&#8221;); let l = str.lastIndexOf(&#8220;\u7a0b\u5e8f&#8221;); console.log(&#8216;indexOf=%d,lastIndexOf=%d&#8217;, i, l); let c = str.localeCompare(&#8216;\u7a0b\u5e8f&#8217;); let m = str.match(&#8216;\u7a0b\u5e8f&#8217;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-33340","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=33340"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33340\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=33340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=33340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=33340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}