Skip to content

Compares old and new version of text. Highlights changed words by tags.

Notifications You must be signed in to change notification settings

alrasek/string-version-comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

string-version-comparison

Util file with methods for getting text with differences from changing old to new version of given text. Comparing old and new versions of String. Result is a string with highlighted by tag words which have changed. Methods:

  • getComparisonString(String oldInstance, String newInstance) : Returns result string which combines old value with highlighted added and deleted words. * Added words are between [<added>] and [</added>]. * Deleted words are between [<deleted>] and [</deleted>].

    Example:

    newInstance= "Chcecie bajki. Byla sobie pchla szachrajka";
    oldInstance= "Chcecie bajki oto bajka. Byla sobie pchla szachrajka";
    result = "Chcecie [<added>]bajki. [</added>][<deleted>]bajki oto bajka. [</deleted>]Byla sobie pchla szachrajka ";

  • getComparisonStringHtmlDecoratedWithClasses(String oldInstance, String newInstance) : Returns result string which combines old value with highlighted added and deleted words. * Added words are between <span class="addedWords"> and </span>. * Deleted words are between <span class="deletedWords"> and </span>.

About

Compares old and new version of text. Highlights changed words by tags.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages