{"id":5444,"date":"2023-01-05T12:41:14","date_gmt":"2023-01-05T04:41:14","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=5444"},"modified":"2023-01-05T12:41:14","modified_gmt":"2023-01-05T04:41:14","slug":"%e4%ba%86%e8%a7%a3typescript%e5%ad%97%e4%b8%b2%e7%9a%84%e6%b1%82%e6%98%af%e5%90%a6%e7%82%ba%e5%a4%a7%e5%b0%8f%e5%af%ab%e6%b7%b7%e5%90%88%e5%ad%97%e7%ac%a6%e4%b8%b2ismixedcase","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/typescript\/%e4%ba%86%e8%a7%a3typescript%e5%ad%97%e4%b8%b2%e7%9a%84%e6%b1%82%e6%98%af%e5%90%a6%e7%82%ba%e5%a4%a7%e5%b0%8f%e5%af%ab%e6%b7%b7%e5%90%88%e5%ad%97%e7%ac%a6%e4%b8%b2ismixedcase\/","title":{"rendered":"\u4e86\u89e3TypeScript\u5b57\u4e32\u7684\u6c42\u662f\u5426\u70ba\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32(isMixedCase)"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"TypeScript, \u5b57\u4e32, \u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32, isMixedCase\"><\/p>\n<h1>\u4f7f\u7528 TypeScript \u5224\u65b7\u5b57\u4e32\u662f\u5426\u70ba\u5927\u5c0f\u5beb\u6df7\u5408\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\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\uff0c\u9019\u53ef\u4ee5\u900f\u904e TypeScript \u7684 isMixedCase() \u65b9\u6cd5\u4f86\u5b8c\u6210\u3002<\/p>\n<h2>isMixedCase() \u65b9\u6cd5<\/h2>\n<p>isMixedCase() \u65b9\u6cd5\u53ef\u4ee5\u7528\u4f86\u5224\u65b7\u4e00\u500b\u5b57\u4e32\u662f\u5426\u70ba\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\uff0c\u5b83\u6703\u56de\u50b3\u4e00\u500b\u5e03\u6797\u503c\uff0c\u5982\u679c\u5b57\u4e32\u662f\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\uff0c\u5247\u56de\u50b3 true\uff0c\u53cd\u4e4b\u5247\u56de\u50b3 false\u3002<\/p>\n<p>isMixedCase() \u65b9\u6cd5\u7684\u8a9e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: typescript\">\nisMixedCase(str: string): boolean\n<\/pre>\n<p>\u5176\u4e2d str \u662f\u8981\u5224\u65b7\u7684\u5b57\u4e32\uff0c\u56de\u50b3\u503c\u70ba\u5e03\u6797\u503c\uff0ctrue \u8868\u793a\u5b57\u4e32\u662f\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\uff0cfalse \u8868\u793a\u5b57\u4e32\u4e0d\u662f\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\u3002<\/p>\n<h2>\u7bc4\u4f8b<\/h2>\n<p>\u4e0b\u9762\u662f\u4e00\u500b\u4f7f\u7528 isMixedCase() \u65b9\u6cd5\u5224\u65b7\u5b57\u4e32\u662f\u5426\u70ba\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\u7684\u7bc4\u4f8b\uff1a<\/p>\n<pre class=\"brush: typescript\">\nlet str1 = \"HelloWorld\";\nlet str2 = \"HelloWorld123\";\n\nconsole.log(isMixedCase(str1)); \/\/ false\nconsole.log(isMixedCase(str2)); \/\/ true\n<\/pre>\n<p>\u5728\u4e0a\u9762\u7684\u7bc4\u4f8b\u4e2d\uff0c\u6211\u5011\u5b9a\u7fa9\u4e86\u5169\u500b\u5b57\u4e32 str1 \u548c str2\uff0cstr1 \u662f\u55ae\u4e00\u5927\u5c0f\u5beb\u5b57\u7b26\u4e32\uff0cstr2 \u662f\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\uff0c\u6211\u5011\u5c07\u5169\u500b\u5b57\u4e32\u50b3\u5165 isMixedCase() \u65b9\u6cd5\uff0c\u6703\u5f97\u5230\u4e0d\u540c\u7684\u7d50\u679c\uff0cstr1 \u7684\u7d50\u679c\u70ba false\uff0cstr2 \u7684\u7d50\u679c\u70ba true\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5011\u4ecb\u7d39\u4e86 TypeScript \u4e2d\u7684 isMixedCase() \u65b9\u6cd5\uff0c\u5b83\u53ef\u4ee5\u7528\u4f86\u5224\u65b7\u4e00\u500b\u5b57\u4e32\u662f\u5426\u70ba\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\uff0c\u4e26\u4e14\u7d66\u51fa\u4e86\u4e00\u500b\u7c21\u55ae\u7684\u7bc4\u4f8b\u4f86\u8aaa\u660e\u5982\u4f55\u4f7f\u7528 isMixedCase() \u65b9\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981(Description):TypeScript\u63d0\u4f9b\u4e86\u4e00\u500bisMixedCase()\u51fd\u6578\uff0c\u53ef\u4ee5\u7528\u4f86\u6aa2\u67e5\u5b57\u4e32\u662f\u5426\u70ba\u5927\u5c0f\u5beb\u6df7\u5408\u5b57\u7b26\u4e32\uff0c\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u8f15\u9b06\u5730\u6aa2\u67e5\u5b57\u4e32\u7684\u5927\u5c0f\u5beb\u6df7\u5408\u60c5\u6cc1\uff0c\u4ee5\u78ba\u4fdd\u7a0b\u5f0f\u78bc\u7684\u6b63\u78ba\u6027\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-5444","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-1pO","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5444","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=5444"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5444\/revisions"}],"predecessor-version":[{"id":5445,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/5444\/revisions\/5445"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=5444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=5444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=5444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}