{"id":2986,"date":"2025-11-21T20:36:15","date_gmt":"2025-11-21T12:36:15","guid":{"rendered":"https:\/\/zhenti.52daan.com\/?p=2986"},"modified":"2025-11-21T20:36:15","modified_gmt":"2025-11-21T12:36:15","slug":"%e5%81%87%e5%ae%9a%e6%9c%89%e4%bb%a5%e4%b8%8b%e5%87%bd%e6%95%b0%e8%bf%87%e7%a8%8b%ef%bc%9a-function-funs-as-string-as-string-dim-s1-as-string-for-i-1-to-lens-s1-ucasemids-i-1-s1-next-i","status":"publish","type":"post","link":"https:\/\/zhenti.52daan.com\/?p=2986","title":{"rendered":"\u5047\u5b9a\u6709\u4ee5\u4e0b\u51fd\u6570\u8fc7\u7a0b\uff1a Function Fun(s As String) As String Dim s1 As String For i = 1 To Len(s) s1 = UCase(Mid(s, i, 1)) + s1 Next i Fun = s1 End Function \u5728\u7a97\u4f53\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u547d\u4ee4\u6309\u94ae\uff0c\u7136\u540e\u7f16\u5199\u5982\u4e0b\u4e8b\u4ef6\u8fc7\u7a0b\uff1a Private Sub Command1_Click() Dim Str1 As String Dim Str2 As String Str1 = InputBox(&#8220;\u8bf7\u8f93\u5165\u4e00\u4e2a\u5b57\u7b26\u4e32&#8221;) Str2 = Fun(Str1) Print Str2 End Sub \u7a0b\u5e8f\u8fd0\u884c\u540e\uff0c\u5355\u51fb\u547d\u4ee4\u6309\u94ae\uff0c\u5982\u679c\u5728\u8f93\u5165\u5bf9\u8bdd\u6846\u4e2d\u8f93\u5165\u5b57\u7b26\u4e32\u201cabcdefg\u201d\uff0c\u5219\u5355\u51fb\u201c\u786e\u5b9a\u201d\u6309\u94ae\u540e\u518d\u7a97\u4f53\u4e0a\u8f93\u51fa\u7684\u7ed3\u679c\u4e3a\uff08 \uff09\u3002 gfedcba ABCDEFG Abcdefg GFEDCBA A. B. C. D."},"content":{"rendered":"<p>\u5047\u5b9a\u6709\u4ee5\u4e0b\u51fd\u6570\u8fc7\u7a0b\uff1a Function Fun(s As String) As String Dim s1 As String For i = 1 To Len(s) s1 = UCase(Mid(s, i, 1)) + s1 Next i Fun = s1 End Function \u5728\u7a97\u4f53\u4e0a\u6dfb\u52a0\u4e00\u4e2a\u547d\u4ee4\u6309\u94ae\uff0c\u7136\u540e\u7f16\u5199\u5982\u4e0b\u4e8b\u4ef6\u8fc7\u7a0b\uff1a Private Sub Command1_Click() Dim Str1 As String Dim Str2 As String Str1 = InputBox(&#8220;\u8bf7\u8f93\u5165\u4e00\u4e2a\u5b57\u7b26\u4e32&#8221;) Str2 = Fun(Str1) Print Str2 End Sub \u7a0b\u5e8f\u8fd0\u884c\u540e\uff0c\u5355\u51fb\u547d\u4ee4\u6309\u94ae\uff0c\u5982\u679c\u5728\u8f93\u5165\u5bf9\u8bdd\u6846\u4e2d\u8f93\u5165\u5b57\u7b26\u4e32\u201cabcdefg\u201d\uff0c\u5219\u5355\u51fb\u201c\u786e\u5b9a\u201d\u6309\u94ae\u540e\u518d\u7a97\u4f53\u4e0a\u8f93\u51fa\u7684\u7ed3\u679c\u4e3a\uff08 \uff09\u3002 gfedcba ABCDEFG Abcdefg GFEDCBA A. B. C. D.<\/p>\n<p>\u6b63\u786e\u7b54\u6848\uff1aD<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5047\u5b9a\u6709\u4ee5\u4e0b\u51fd\u6570\u8fc7\u7a0b\uff1a Funct&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[106],"class_list":["post-2986","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-visual-basic"],"_links":{"self":[{"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=\/wp\/v2\/posts\/2986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2986"}],"version-history":[{"count":0,"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=\/wp\/v2\/posts\/2986\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhenti.52daan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}