| |

VerySource

 Forgot password?
 Register
Search
View: 698|Reply: 5

How to turn an HTML formatted string into a txt formatted string?

[Copy link]

2

Threads

11

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-1-19 10:00:01
| Show all posts |Read mode
String content = "Hello testing! <br/> <a href='http://java.sun.com' target='_blank'> GoTo Sun </a> <br/> Regards";

After becoming the general txt format, it is printed as follows:

Hello testing!
GoTo Sun
Regards

I don't know if java provides related class library processing
Reply

Use magic Report

0

Threads

18

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-1-26 15:36:01
| Show all posts
Parse html with HTMLParser
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-26 21:36:01
| Show all posts
The a.jsp page is as follows:

<html>
<body>
<%
String content = "Hello testing! <br/> <a href='http://java.sun.com' target='_blank'> GoTo Sun </a> <br/> Regards";
out.println (content);
%>
</ body>
</ html>
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-26 22:00:02
| Show all posts
Ha ha The system defaults you to use JSP technology
Reply

Use magic Report

2

Threads

11

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

 Author| Post time: 2020-1-27 21:54:01
| Show all posts
Which package is HTMLParser in? I want to see its help information.
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 France

Post time: 2020-1-28 01:00:02
| Show all posts
HTMLParser is a third-party open source project

References:
HTML Parser project home page http://htmlparser.sourceforge.net/
Download address http://sourceforge.net/projects/htmlparser
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list