Check if string has suffix


I have a string and want to check if there is a specific suffix.


// String literal
var a = "Hello World!"

// Check if there is a specific Suffix

if a.hasSuffix("World!") {
    print("Yes, there is")
else {


Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)