hasPrefix(_:)
Returns a Boolean value that indicates whether a given string matches the beginning characters of the receiver.
Declaration
func hasPrefix(_ str: String) -> BoolParameters
- str:
A string.
Return Value
true if aString matches the beginning characters of the receiver, otherwise false. Returns false if aString is empty.
Discussion
This method is a convenience for comparing strings using the NSAnchoredSearch option. See String Programming Guide for more information.