-
-
Save fitomad/c747388b45893e52b3091d26daf9cb90 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
// Un String con texto | |
let modeloTelefono: String = "iPhone 6s" | |
// Un String vacio | |
let ubicacionDispositivo: String = "" | |
// ¿Y qué pasa con el espacio en blanco? | |
let espacioEnBlanco: String = " " | |
if modeloTelefono.isEmpty | |
{ | |
print("No hay nada en la variable `modeloTelefono`") | |
} | |
if ubicacionDispositivo.isEmpty | |
{ | |
print("No hay nada en la variable `ubicacionDispositivo`") | |
} | |
if !espacioEnBlanco.isEmpty | |
{ | |
print("Los espacios en blanco sí son caracteres válidos y cuentan como tal") | |
} | |
/* | |
No hay nada en la variable `ubicacionDispositivo` | |
Los espacios en blanco SÍ son caracteres válidos y cuentan como tal | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment