In Objective-C the code to check for a substring in an NSString is:
NSString *string = @\"hello Swift\";
NSRange textRange =[strin
You don't need to write any custom code for this. Starting from the 1.2 version Swift has already had all the methods you need:
count(string);contains(string, substring);startsWith(string, substring)