{"id":5376,"date":"2023-01-05T12:33:03","date_gmt":"2023-01-05T04:33:03","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=5376"},"modified":"2023-01-05T12:33:03","modified_gmt":"2023-01-05T04:33:03","slug":"1-%e4%ba%86%e8%a7%a3typescript%e4%b8%ad%e5%ad%97%e4%b8%b2%e7%9a%84%e6%b1%82%e6%98%af%e5%90%a6%e7%82%ba%e9%a6%96%e5%ad%97%e6%af%8d%e5%a4%a7%e5%af%ab%e5%ad%97%e7%ac%a6%e4%b8%b2istitlecase%e7%9a%84","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/typescript\/1-%e4%ba%86%e8%a7%a3typescript%e4%b8%ad%e5%ad%97%e4%b8%b2%e7%9a%84%e6%b1%82%e6%98%af%e5%90%a6%e7%82%ba%e9%a6%96%e5%ad%97%e6%af%8d%e5%a4%a7%e5%af%ab%e5%ad%97%e7%ac%a6%e4%b8%b2istitlecase%e7%9a%84\/","title":{"rendered":"1.\u4e86\u89e3TypeScript\u4e2d\u5b57\u4e32\u7684\u6c42\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32(isTitleCase)\u7684\u529f\u80fd"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"TypeScript, \u5b57\u4e32, \u6c42\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32, isTitleCase\"><\/p>\n<h1>\u4f7f\u7528 TypeScript \u5b57\u4e32\u7684\u6c42\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32(isTitleCase)<\/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\u5730\u958b\u767c\u51fa\u66f4\u512a\u79c0\u7684\u7a0b\u5f0f\u78bc\u3002\u5176\u4e2d\u4e00\u500b\u529f\u80fd\u5c31\u662f\u53ef\u4ee5\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\uff0c\u9019\u500b\u529f\u80fd\u53ef\u4ee5\u4f7f\u7528 isTitleCase() \u4f86\u5b8c\u6210\u3002<\/p>\n<p>isTitleCase() \u662f TypeScript \u4e2d\u7684\u4e00\u500b\u51fd\u5f0f\uff0c\u5b83\u53ef\u4ee5\u6aa2\u67e5\u4e00\u500b\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002\u5b83\u6703\u56de\u50b3\u4e00\u500b\u5e03\u6797\u503c\uff0c\u5982\u679c\u5b57\u4e32\u7684\u9996\u5b57\u6bcd\u662f\u5927\u5beb\u7684\uff0c\u5247\u56de\u50b3 true\uff0c\u53cd\u4e4b\u5247\u56de\u50b3 false\u3002<\/p>\n<p>isTitleCase() \u7684\u4f7f\u7528\u65b9\u6cd5\u5f88\u7c21\u55ae\uff0c\u53ea\u9700\u8981\u50b3\u5165\u4e00\u500b\u5b57\u4e32\u53c3\u6578\uff0c\u5c31\u53ef\u4ee5\u6aa2\u67e5\u8a72\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff1a<\/p>\n<pre class=\"brush: typescript\">\nlet str = \"Hello World\";\nlet isTitleCase = isTitleCase(str);\nconsole.log(isTitleCase); \/\/ false\n<\/pre>\n<p>\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u4e2d\uff0c\u6211\u5011\u50b3\u5165\u4e00\u500b\u5b57\u4e32 &#8220;Hello World&#8221;\uff0c\u7136\u5f8c\u5c07\u7d50\u679c\u5b58\u5165 isTitleCase \u8b8a\u6578\u4e2d\uff0c\u6700\u5f8c\u5c07\u7d50\u679c\u8f38\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u7d50\u679c\u70ba false\uff0c\u8868\u793a\u8a72\u5b57\u4e32\u4e0d\u662f\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u53e6\u5916\uff0cisTitleCase() \u51fd\u5f0f\u4e5f\u53ef\u4ee5\u6aa2\u67e5\u591a\u500b\u5b57\u4e32\uff0c\u53ea\u9700\u8981\u50b3\u5165\u591a\u500b\u5b57\u4e32\u53c3\u6578\uff0c\u5c31\u53ef\u4ee5\u6aa2\u67e5\u591a\u500b\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff1a<\/p>\n<pre class=\"brush: typescript\">\nlet str1 = \"Hello World\";\nlet str2 = \"Hello\";\nlet isTitleCase = isTitleCase(str1, str2);\nconsole.log(isTitleCase); \/\/ [false, true]\n<\/pre>\n<p>\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u4e2d\uff0c\u6211\u5011\u50b3\u5165\u5169\u500b\u5b57\u4e32 &#8220;Hello World&#8221; \u548c &#8220;Hello&#8221;\uff0c\u7136\u5f8c\u5c07\u7d50\u679c\u5b58\u5165 isTitleCase \u8b8a\u6578\u4e2d\uff0c\u6700\u5f8c\u5c07\u7d50\u679c\u8f38\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u7d50\u679c\u70ba [false, true]\uff0c\u8868\u793a\u7b2c\u4e00\u500b\u5b57\u4e32\u4e0d\u662f\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\uff0c\u800c\u7b2c\u4e8c\u500b\u5b57\u4e32\u5247\u662f\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u7e3d\u7d50\u4f86\u8aaa\uff0cisTitleCase() \u662f TypeScript \u4e2d\u4e00\u500b\u5f88\u6709\u7528\u7684\u51fd\u5f0f\uff0c\u5b83\u53ef\u4ee5\u6aa2\u67e5\u4e00\u500b\u6216\u591a\u500b\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5bb9\u6613\u5730\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u7b26\u5408\u6a19\u6e96\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u5982\u4f55\u4f7f\u7528 isTitleCase() \u51fd\u5f0f<\/h2>\n<p>\u4f7f\u7528 isTitleCase() \u51fd\u5f0f\u5f88\u7c21\u55ae\uff0c\u53ea\u9700\u8981\u50b3\u5165\u4e00\u500b\u6216\u591a\u500b\u5b57\u4e32\u53c3\u6578\uff0c\u5c31\u53ef\u4ee5\u6aa2\u67e5\u8a72\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff1a<\/p>\n<pre class=\"brush: typescript\">\nlet str = \"Hello World\";\nlet isTitleCase = isTitleCase(str);\nconsole.log(isTitleCase); \/\/ false\n<\/pre>\n<p>\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u4e2d\uff0c\u6211\u5011\u50b3\u5165\u4e00\u500b\u5b57\u4e32 &#8220;Hello World&#8221;\uff0c\u7136\u5f8c\u5c07\u7d50\u679c\u5b58\u5165 isTitleCase \u8b8a\u6578\u4e2d\uff0c\u6700\u5f8c\u5c07\u7d50\u679c\u8f38\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u7d50\u679c\u70ba false\uff0c\u8868\u793a\u8a72\u5b57\u4e32\u4e0d\u662f\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u53e6\u5916\uff0cisTitleCase() \u51fd\u5f0f\u4e5f\u53ef\u4ee5\u6aa2\u67e5\u591a\u500b\u5b57\u4e32\uff0c\u53ea\u9700\u8981\u50b3\u5165\u591a\u500b\u5b57\u4e32\u53c3\u6578\uff0c\u5c31\u53ef\u4ee5\u6aa2\u67e5\u591a\u500b\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff1a<\/p>\n<pre class=\"brush: typescript\">\nlet str1 = \"Hello World\";\nlet str2 = \"Hello\";\nlet isTitleCase = isTitleCase(str1, str2);\nconsole.log(isTitleCase); \/\/ [false, true]\n<\/pre>\n<p>\u4e0a\u9762\u7684\u7a0b\u5f0f\u78bc\u4e2d\uff0c\u6211\u5011\u50b3\u5165\u5169\u500b\u5b57\u4e32 &#8220;Hello World&#8221; \u548c &#8220;Hello&#8221;\uff0c\u7136\u5f8c\u5c07\u7d50\u679c\u5b58\u5165 isTitleCase \u8b8a\u6578\u4e2d\uff0c\u6700\u5f8c\u5c07\u7d50\u679c\u8f38\u51fa\u5230\u63a7\u5236\u53f0\uff0c\u7d50\u679c\u70ba [false, true]\uff0c\u8868\u793a\u7b2c\u4e00\u500b\u5b57\u4e32\u4e0d\u662f\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\uff0c\u800c\u7b2c\u4e8c\u500b\u5b57\u4e32\u5247\u662f\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\u3002<\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>\u7e3d\u7d50\u4f86\u8aaa\uff0cisTitleCase() \u662f TypeScript \u4e2d\u4e00\u500b\u5f88\u6709\u7528\u7684\u51fd\u5f0f\uff0c\u5b83\u53ef\u4ee5\u6aa2\u67e5\u4e00\u500b\u6216\u591a\u500b\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5bb9\u6613\u5730\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u7b26\u5408\u6a19\u6e96\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2.\u672c\u6587\u5c07\u4ecb\u7d39TypeScript\u4e2d\u5b57\u4e32\u7684\u6c42\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\u5b57\u7b26\u4e32(isTitleCase)\u7684\u529f\u80fd\uff0c\u4e26\u8a73\u7d30\u89e3\u91cb\u5982\u4f55\u4f7f\u7528\u5b83\u4f86\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u70ba\u9996\u5b57\u6bcd\u5927\u5beb\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-5376","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-1oI","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5376","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=5376"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5376\/revisions"}],"predecessor-version":[{"id":5377,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5376\/revisions\/5377"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=5376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=5376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=5376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}