{"id":5284,"date":"2023-01-05T12:22:56","date_gmt":"2023-01-05T04:22:56","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=5284"},"modified":"2023-01-05T12:22:56","modified_gmt":"2023-01-05T04:22:56","slug":"%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8typescript%e5%ad%97%e4%b8%b2%e7%9a%84islowercase%e5%87%bd%e6%95%b8","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/typescript\/%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8typescript%e5%ad%97%e4%b8%b2%e7%9a%84islowercase%e5%87%bd%e6%95%b8\/","title":{"rendered":"\u5b78\u7fd2\u5982\u4f55\u4f7f\u7528TypeScript\u5b57\u4e32\u7684isLowerCase()\u51fd\u6578"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"TypeScript, \u5b57\u4e32, \u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32, isLowerCase\"><\/p>\n<h1>\u4f7f\u7528 TypeScript \u5224\u65b7\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32<\/h1>\n<p>TypeScript \u662f\u4e00\u7a2e JavaScript \u7684\u8d85\u96c6\uff0c\u5b83\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5bb9\u6613\u958b\u767c\u51fa\u66f4\u512a\u8cea\u7684\u7a0b\u5f0f\u78bc\u3002\u5176\u4e2d\u4e00\u500b\u529f\u80fd\u5c31\u662f\u53ef\u4ee5\u5224\u65b7\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\uff0c\u9019\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5bb9\u6613\u5730\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u7b26\u5408\u67d0\u4e9b\u898f\u5247\u3002<\/p>\n<h2>TypeScript \u4e2d\u7684 isLowerCase \u51fd\u5f0f<\/h2>\n<p>TypeScript \u4e2d\u6709\u4e00\u500b\u540d\u70ba <strong>isLowerCase<\/strong> \u7684\u51fd\u5f0f\uff0c\u53ef\u4ee5\u7528\u4f86\u5224\u65b7\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\u3002\u5b83\u7684\u7528\u6cd5\u975e\u5e38\u7c21\u55ae\uff0c\u53ea\u9700\u8981\u50b3\u5165\u4e00\u500b\u5b57\u4e32\u53c3\u6578\uff0c\u5c31\u53ef\u4ee5\u5224\u65b7\u8a72\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\u3002\u5982\u679c\u662f\uff0c\u5247\u6703\u56de\u50b3 <span style=\"color: #009900;\">true<\/span>\uff0c\u5426\u5247\u5247\u6703\u56de\u50b3 <span style=\"color: #990000;\">false<\/span>\u3002<\/p>\n<pre class=\"brush: typescript\">\nfunction isLowerCase(str: string): boolean {\n  return str === str.toLowerCase();\n}\n<\/pre>\n<p>\u4f8b\u5982\uff0c\u6211\u5011\u53ef\u4ee5\u4f7f\u7528 <strong>isLowerCase<\/strong> \u51fd\u5f0f\u4f86\u5224\u65b7\u4e00\u500b\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\uff1a<\/p>\n<pre class=\"brush: typescript\">\nlet str = \"Hello World\";\nlet isLowerCase = isLowerCase(str); \/\/ false\n<\/pre>\n<p>\u5728\u9019\u500b\u4f8b\u5b50\u4e2d\uff0c\u6211\u5011\u50b3\u5165\u4e86\u4e00\u500b\u5b57\u4e32 <strong>Hello World<\/strong>\uff0c\u7136\u5f8c\u4f7f\u7528 <strong>isLowerCase<\/strong> \u51fd\u5f0f\u4f86\u5224\u65b7\u5b83\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\uff0c\u7d50\u679c\u70ba <span style=\"color: #990000;\">false<\/span>\uff0c\u8868\u793a\u8a72\u5b57\u4e32\u4e0d\u662f\u5c0f\u5beb\u5b57\u7b26\u4e32\u3002<\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>TypeScript \u63d0\u4f9b\u4e86\u4e00\u500b\u540d\u70ba <strong>isLowerCase<\/strong> \u7684\u51fd\u5f0f\uff0c\u53ef\u4ee5\u7528\u4f86\u5224\u65b7\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\u3002\u5b83\u7684\u7528\u6cd5\u975e\u5e38\u7c21\u55ae\uff0c\u53ea\u9700\u8981\u50b3\u5165\u4e00\u500b\u5b57\u4e32\u53c3\u6578\uff0c\u5c31\u53ef\u4ee5\u5224\u65b7\u8a72\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\u3002\u9019\u500b\u51fd\u5f0f\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5bb9\u6613\u5730\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u7b26\u5408\u67d0\u4e9b\u898f\u5247\uff0c\u4ee5\u63d0\u9ad8\u7a0b\u5f0f\u78bc\u7684\u54c1\u8cea\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u66f4\u591a TypeScript \u6559\u5b78<\/h2>\n<p>\u60f3\u8981\u5b78\u7fd2\u66f4\u591a TypeScript \u7684\u77e5\u8b58\u55ce\uff1f\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684 <a href=\"https:\/\/www.example.com\/\" target=\"_blank\" rel=\"noopener\">TypeScript \u6559\u5b78<\/a> \u7db2\u7ad9\uff0c\u5728\u9019\u88e1\u4f60\u53ef\u4ee5\u627e\u5230\u66f4\u591a\u6709\u95dc TypeScript \u7684\u77e5\u8b58\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u4f7f\u7528TypeScript\u5b57\u4e32\u7684isLowerCase()\u51fd\u6578\uff0c\u53ef\u4ee5\u8f15\u9b06\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u70ba\u5c0f\u5beb\u5b57\u7b26\u4e32\uff0c\u4e26\u7372\u5f97\u66f4\u597d\u7684\u7a0b\u5f0f\u78bc\u54c1\u8cea\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[187],"tags":[186],"class_list":["post-5284","post","type-post","status-publish","format-standard","hentry","category-typescript","tag-typescript"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1ne","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=5284"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5284\/revisions"}],"predecessor-version":[{"id":5285,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5284\/revisions\/5285"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=5284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=5284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=5284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}