lcsDistance(to:caseSensitive:)

The Longest Common Subsequence (LCS) string distance, i.e. the minimal number of insertions and deletions to transform this string to the given string.

StringProtocol+Extensions.swift:181
func lcsDistance<S>(to rhs: S, caseSensitive: Bool = true) -> Int where S : StringProtocol

This distance is equivalent to self.count + rhs.count minus the length of the LCS between self and rhs.