'  Filename: testStringReverse.bas
'
'  Compile: vbc testStringReverse.bas
'  Execute: testStringReverse
Imports System
Class StringReverseApp
    Shared Sub Main(ByVal args() As String)
        Dim a As String, b As String
        a = "Hello, world!"
        b = "안녕하세요?"
        Dim arr() As Char = a.ToCharArray()
        Array.Reverse(arr)
        Console.WriteLine(New String(arr))
        arr = b.ToCharArray()
        Array.Reverse(arr)
        Console.WriteLine(New String(arr))
    End Sub
End Class
' ===================
' Expected result:
' !dlrow ,olleH
' ?요세하녕안
' ===================


 

크리에이티브 커먼즈 라이선스
Creative Commons License

 

Posted by Scripter
,