There is now the built in ability to detect empty string with .isEmpty
:
if emptyString.isEmpty {
print("Nothing to see here")
}
Apple Pre-release documentation: “Strings and Characters”.
More Related Contents:
- Nested Dictionary in my swift application
- BigInteger equivalent in Swift?
- How to use special character in NSURL?
- What protocol should be adopted by a Type for a generic function to take any number type as an argument in Swift?
- Swift: print() vs println() vs NSLog()
- Deleting list elements from SwiftUI’s List
- How to print double quotes inside “”?
- Swift extension example
- Implementing copy() in Swift
- Prevent dismissal of UIAlertController
- Swift function object wrapper in apple/swift
- Swift Alamofire: How to get the HTTP response status code
- How does one make an optional closure in swift?
- UITextView with hyperlink text
- How to pass multiple enum values as a function parameter
- First item in a List is always selected
- How do I make my exponentiation operator work with all numeric types in Swift?
- SwiftUI: Forcing an Update
- NSFileManager fileExistsAtPath:isDirectory and swift
- Get class name of object as string in Swift
- Get terminal output after a command swift
- removeObjectsAtIndexes for Swift arrays
- Generating random numbers with Swift
- AlamoFire asynchronous completionHandler for JSON request
- Can you override between extensions in Swift or not? (Compiler seems confused!)
- Thread 1: EXC_BAD_INSTRUCTION when fetching data
- iOS9 Swift File Creating NSFileManager.createDirectoryAtPath with NSURL
- How do I perform an auto-segue in Xcode 6 using Swift?
- Can Swift convert a class / struct data into dictionary?
- No Such Module ‘Parse’