You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,16 +17,18 @@ java lcs.StringDiff
17
17
18
18
# Example
19
19
20
+
Setting the following strings:
20
21
```
21
22
text1 = "Do not change this section. Please check any misqelling! Note that this section is obsolete.";
22
23
text2 = "New section added. Do not change this section. Please check any mispelling!";
23
-
24
-
Running the application with command "java lcs.StringDiff":
25
-
24
+
```
25
+
running the command "java lcs.StringDiff" will generate the following html fragment:
26
+
```
26
27
<ins style='background-color:#00ff66'>New section added. </ins>Do not change this section. Please check any mis<del style='background-color:#ff9933'>q</del><ins style='background-color:#00ff66'>p</ins>elling!<del style='background-color:#ff9933'> Note that this section is obsolete.</del>
27
28
```
28
29
If you load the html fragment with a browser, you get the following result:
29
30
31
+

30
32
31
33
# Credits
32
34
The longest common substrings are found using the LongestCommonSubstring (LCS) algorithm credited to https://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/LongestCommonSubstring.java.html
0 commit comments