Function similarity

  • Check how similar two strings are

    Parameters

    • a: string
    • b: string

    Returns number

    Example

    import { string } from "@rjweb/utils"

    string.similarity('Hello', 'Hello') // 100
    string.similarity('Hello', 'Helo') // 80
    string.similarity('Hello', 'sadfasdf') // 0
    string.similarity('Hello', 'Hello World') // 50

    Since

    1.12.10

    Supports

    nodejs, browser