Created
January 22, 2019 00:47
-
-
Save parzibyte/a0d27234ff9d7611235a237d5aaaf534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
arreglo = ["Ruby", "Perl", "C", "Go", "Rust"] | |
# Si solamente se quiere comprobar si existe, usar include | |
busqueda = "C++" | |
if arreglo.include?(busqueda) | |
puts "El arreglo SÍ tiene el elemento #{busqueda}" | |
else | |
puts "El arreglo no incluye el elemento #{busqueda}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment