Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/main/java/co/ivi/jus/text/review/wxywizard/Island.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2021, Xuelei Fan. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*/

package co.ivi.jus.text.review.wxywizard;

public class Island {
public static void main(String[] args) {
String poetry = """
No man is an island,
Entire of itself,
Every man is a piece of the continent,
A part of the main.
""";
System.out.println(poetry);
// 转义\"""
String poetryHtml =
"<html>\n" +
"<head></head>\n" +
"<body>\n" +
"<div align=\"center\">\n" +
" No man is an island,<br />\n" +
" Entire of itself,<br />\n" +
" Every man is a piece of the continent,<br />\n" +
" A part of the main.\n" +
"</div>\n" +
"</body>\n" +
"</html>\n";
System.out.println(poetryHtml);
System.out.println();
String poetryTextArea = """
<html>
<head></head>
<body>
<div align="center">
No man is an island,<br />
Entire of itself,<br />
Every man is a piece of the continent,<br />
A part of the main.
</div>
</body>
</html>
""";
System.out.println(poetryTextArea);
// 老师为啥我这两个输出是false?
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to remove this comment as it does not apply any longer?

System.out.println(poetryHtml.equals(poetryTextArea));
System.out.println(poetryHtml==poetryTextArea);

}
}
18 changes: 18 additions & 0 deletions src/main/java/co/ivi/jus/text/review/wxywizard/poetry.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>poetry</title>
</head>
<body>
<html>
<head></head>
<body>
<div align="center">
No man is an island,<br />
Entire of itself,<br />
Every man is a piece of the continent,<br />
A part of the main.
</div>
</body>
</html>