StringProtocol

public extension StringProtocol
  • SwifterSwift: The longest common suffix.

       "Hello world!".commonSuffix(with: "It's cold!") = "ld!"
    

    Declaration

    Swift

    func commonSuffix<T>(with aString: T, options: String.CompareOptions = []) -> String where T : StringProtocol

    Return Value

    The longest common suffix of the receiver and the given String