Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 22, 2019 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/2858590446771fdc3177735ec4e0f55b to your computer and use it in GitHub Desktop.
Save parzibyte/2858590446771fdc3177735ec4e0f55b to your computer and use it in GitHub Desktop.
public static string Invertir(string cadena){
// Convertir a arreglo
char[] cadenaComoCaracteres = cadena.ToCharArray();
// Invertir el arreglo usando métodos incorporados
Array.Reverse(cadenaComoCaracteres);
// Convertir de nuevo el arreglo a cadena
return new string(cadenaComoCaracteres);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment