Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment