O'Reilly logo

Swift Programming: The Big Nerd Ranch Guide by John Gallagher, Matthew Mathias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bronze Challenge

Create a new String instance called empty and give it an empty string: let empty = "". It is useful to be able to tell if a string has any characters in it. Use the startIndex and endIndex properties on empty to determine whether this string is truly empty. Next, consult the documentation via the Help menu item in Xcode for a cleaner way to accomplish this check.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required