Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dcf9594

Browse files
authored
Update README.md
1 parent 2c9c528 commit dcf9594

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ java lcs.StringDiff
1717

1818
# Example
1919

20+
Setting the following strings:
2021
```
2122
text1 = "Do not change this section. Please check any misqelling! Note that this section is obsolete.";
2223
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+
```
2627
<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>
2728
```
2829
If you load the html fragment with a browser, you get the following result:
2930

31+
![html fragment in a browser](diff_html_rendering.png)
3032

3133
# Credits
3234
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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /