Ejercicio
Reverso, recursivo
Objetivo
Cree un programa que use la recursividad para invertir una cadena de caracteres (por ejemplo, desde "Hello" devolvería "olleH").
Código
Imports System
Public Class exercise128
Public Shared Function Reverse(ByVal text As String) As String
If text.Length <= 1 Then Return text
Dim firstLetter As Char = text(0)
Dim rest As String = text.Substring(1)
Return Reverse(rest) & firstLetter
End Function
Public Shared Sub Main(ByVal args As String())
Console.WriteLine(Reverse("Juan"))
End Sub
End Class