2009年2月27日 星期五

99-21

image

'21.將輸入字串之英文字母大小寫互換。

Public Class Form1 
    Dim i
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim a1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        Dim a2 = "abcdefghijklmnopqrstuvwxyz"
        Dim f = "APPLE"
        Dim c = f
        For i = 1 To 26
            c = Replace(c, Mid(a1, i, 1), Mid(a2, i, 1))
        Next
        MsgBox(f & " 英文轉換大小寫: " & c)
    End Sub
End Class

沒有留言:

張貼留言