{"id":713,"date":"2019-05-01T17:47:20","date_gmt":"2019-05-01T09:47:20","guid":{"rendered":"http:\/\/www.eait.co\/?p=713"},"modified":"2019-05-01T17:47:20","modified_gmt":"2019-05-01T09:47:20","slug":"%e5%88%97%e8%a1%a8%e6%93%8d%e4%bd%9c%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/notes.coremix.net\/?p=713","title":{"rendered":"\u5217\u8868\u64cd\u4f5c\u65b9\u6cd5"},"content":{"rendered":"<div>\u5b57\u7b26\u4e32\u64cd\u4f5c\uff1a<\/div>\n<div>a = &#8216;dudyydyhy&#8217;<\/div>\n<div>a.count(\u5185\u5bb9,\u4ece\u7b2c\u51e0\u4e2a\u5f00\u59cb\uff09<\/div>\n<div>a.find\uff08\u5185\u5bb9,\u4ece\u7b2c\u51e0\u4e2a\uff09<\/div>\n<div>a.index(\u5185\u5bb9\uff09\u8fd4\u56de\u5185\u5bb9\u7b2c\u4e00\u4e2a\u7684\u4f4d\u7f6e<\/div>\n<div>a.isdigit\u5224\u65ad\u662f\u5426\u5168\u662f\u6570\u5b57<\/div>\n<div>a.isalpha\u5224\u65ad\u662f\u5426\u5168\u662f\u5b57\u6bcd<\/div>\n<div>a.endswith<\/div>\n<div>a.startwith<\/div>\n<div>a.islower\u5224\u65ad\u662f\u5426\u5168\u662f\u5c0f\u5199<\/div>\n<div>a.isupper\u5224\u65ad\u662f\u5426\u5168\u662f\u5927\u5199<\/div>\n<div><\/div>\n<div>\u6539(\u8f6c\u4e49)\uff1a<\/div>\n<div>a.upper<\/div>\n<div>a.lower<\/div>\n<div>a.strip\u5220\u9664\u7a7a\u683c(lstrip,rstrip)\u5de6\u7a7a\u683c\u53f3\u7a7a\u683c<\/div>\n<div>a.capitalize\u9996\u5b57\u6bcd\u6539\u5927\u5199<\/div>\n<div>a.title\u6240\u6709\u5355\u8bcd\u9996\u5b57\u6bcd\u5927\u5199<\/div>\n<div>a.split\u5206\u5272\u5b57\u7b26\u4e32<\/div>\n<div>\\n\u00a0 \u00a0\u00a0\u00a0 \u00a0\u6362\u884c<\/div>\n<div>\\t\u00a0 \u00a0\u00a0 \u00a0 \u6c34\u5e73\u5236\u8868\u7b26<\/div>\n<div>\\b\u00a0\u00a0 \u00a0 \u9000\u683c<\/div>\n<div>\\r\u00a0\u00a0 \u00a0 \u56de\u8f66\uff0c\u5f53\u524d\u4f4d\u7f6e\u79fb\u52a8\u5230\u672c\u884c\u5f00\u5934\u5e76\u66ff\u6362\u5f00\u5934\u7b49\u6570\u91cf\u7684\u5b57\u6bcd<\/div>\n<div>\\\\\u4ee3\u8868\u53cd\u659c\u6760<\/div>\n<div>\\0\u7a7a\u5b57\u7b26<\/div>\n<div>\\a\u7cfb\u7edf\u63d0\u793a\u97f3<\/div>\n<div>\u5728python\u4e2d\u5982\u679c\u8981\u53bb\u6389\u5b57\u7b26\u4e32\u7684\u8f6c\u4e49\uff0c\u53ea\u9700\u8981\u5728\u5b57\u7b26\u4e32\u524d\u9762\u52a0\u4e0a r<\/div>\n<div><\/div>\n<div>a=\u6f6d\u5dde.encode(encoding = &#8216;UTF-8&#8217;)<\/div>\n<div>a.decode(encoding = &#8216;UTF-8)<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u5217\u8868<\/div>\n<div>a.append()\u589e\u52a0\u5230\u6700\u540e<\/div>\n<div>insert(3,x)\u4e0b\u6807\u7b2c\u4e09\u4e2a\u5143\u7d20\u524d\u9762\u52a0x<\/div>\n<div>extend()\u00a0\u589e\u52a0\u62ec\u53f7\u5185\u7684\u5185\u5bb9\u5230\u6700\u540e\uff0c\u53ef\u589e\u52a0\u5b57\u7b26\u4e32\u548c\u5217\u8868\uff08\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff09<\/div>\n<div><\/div>\n<div>\u5220<\/div>\n<div>a.remove()\u4ece\u5217\u8868\u4e2d\u5220\u9664\u62ec\u53f7\u5185\u7684\u5143\u7d20<\/div>\n<div>a.pop()\u5220\u9664\u6700\u540e\u7684\u5143\u7d20\u6216\u8005\u5220\u9664\u6307\u5b9a\u4e0b\u6807\u7684\u5143\u7d20<\/div>\n<div>del[0:3]\u5220\u96640-3\u7684\u5143\u7d20<\/div>\n<div>a.clear()\u5220\u9664\u6240\u6709\u5143\u7d20<\/div>\n<div><\/div>\n<div>\u67e5<\/div>\n<div>a.index()\u8fd4\u56de\u6307\u5b9a\u5143\u7d20\u7684\u4e0b\u6807\uff0c\u7b2c\u4e00\u4e2a<\/div>\n<div>a.index(a,5)\u4ece\u7b2c6\u4e2a\u5143\u7d20\u5f00\u59cb\u67e5\u627ea<\/div>\n<div>a.count()\u7edf\u8ba1\u67d0\u5143\u7d20\u6570\u91cf<\/div>\n<div><\/div>\n<div>\u6539<\/div>\n<div>a.sort()\u4ece\u5c0f\u5230\u5927\u6392\u5e8f\uff08\u6c38\u4e45\u6539\u53d8\uff09<\/div>\n<div>a.reverse()\u4ece\u5927\u5230\u5c0f\u6392\u5e8f\uff08\u6c38\u4e45\u6539\u53d8\uff09<\/div>\n<div>a.copy()\u590d\u5236<\/div>\n<div><\/div>\n<div><\/div>\n<div>\u5143\u7ec4\u65b9\u6cd5<\/div>\n<div>.count()<\/div>\n<div>.index()<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5b57\u7b26\u4e32\u64cd\u4f5c\uff1a a = &#8216;dudyydyhy&#8217; a.count(\u5185\u5bb9,\u4ece\u7b2c\u51e0\u4e2a\u5f00\u59cb\uff09 a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[20],"class_list":["post-713","post","type-post","status-publish","format-standard","hentry","category-python_note","tag-python"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=713"}],"version-history":[{"count":1,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/713\/revisions"}],"predecessor-version":[{"id":714,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=\/wp\/v2\/posts\/713\/revisions\/714"}],"wp:attachment":[{"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notes.coremix.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}