Swdifft

1.0.0

Swdifft is string diff library of longest common subsequence.
bannzai/Swdifft

What's New

First Release

2019-07-15T16:20:48Z

🎉

Swdifft

Swdifft is string diff library of longest common subsequence.

Usage

Using diff function, Swdifft marked diff between left and right.

let result = diff("ABCDEFGHIJ", "ABCDEFG")
print(result.lhs) // ABCDEFG`HIJ`
print(result.rhs) // ABCDEFG

If it reversed.

let result = diff("ABCDEFG", "ABCDEFGHIJ")
print(result.lhs) // ABCDEFG
print(result.rhs) // ABCDEFG*HIJ*

And it can be print diff.

printDiff("ABCDEFGHIJ", "ABCDEFG") 

Result.

ABCDEFG`HIJ`
ABCDEFG

Swdifft marked symbol's, when string matches the difference. The mark can customize from default setting to use these global variables.

beginLHSMark = "%" // Default is `
endLHSMark = "%" // Default is `
beginRHSMark = "&" // Default is *
endRHSMark = "&" // Default is *

LICENSE

Swdifft is released under the MIT license. See LICENSE for details.

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Oct 20 2024 20:54:52 GMT-0900 (Hawaii-Aleutian Daylight Time)