Returns a string containing characters the receiver and a given string have in common, starting from the beginning of each up to the first characters that aren’t equivalent.
- iOS 2.0+
- macOS 10.0+
- tvOS 9.0+
- watchOS 2.0+
The string with which to compare the receiver.
Options for the comparison. The following search options may be specified by combining them with the C bitwise
NSLiteralSearch. See String Programming Guide for details on these options.
A string containing characters the receiver and
aString have in common, starting from the beginning of each up to the first characters that aren’t equivalent.
The returned string is based on the characters of the receiver. For example, if the receiver is “Ma¨dchen” and
aString is “Mädchenschule”, the string returned is “Ma¨dchen”, not “Mädchen”.