Check if string has prefix


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


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

// Check if there is a specific Prefix

if a.hasPrefix("Hell") {
    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! ;-)