Skip to content

Instantly share code, notes, and snippets.

View quintonpryce's full-sized avatar

Quinton Pryce quintonpryce

  • TextNow
  • Guelph
View GitHub Profile
@RuiNelson
RuiNelson / Levenshtein.swift
Last active August 2, 2023 03:50
Levenshtein distance between two String for Swift 4.x
import Foundation
extension String {
subscript(index: Int) -> Character {
return self[self.index(self.startIndex, offsetBy: index)]
}
}
extension String {
public func levenshtein(_ other: String) -> Int {