Instance Method

contains(_:)

Returns whether the receiver contains a given string by performing a case-sensitive, locale-unaware search.

Declaration

func contains(_ str: String) -> Bool

Parameters

str

The string to search for. This value must not be nil.

Return Value

true if the receiver contains str, otherwise false.

Discussion

Calling this method is equivalent to calling range(of:options:) with no options.