| |

VerySource

 Forgot password?
 Register
Search
View: 605|Reply: 4

That big brother knows how to replace
in the text with

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-1 23:00:01
| Show all posts |Read mode
For example, there is such a piece of source code:
I wo wo wo wo wo wo wo </br>
I wo wo wo wo wo wo wo </br>
I wo wo wo wo wo wo wo </br>
I wo wo wo wo wo wo wo </br>

How to convert this source code into a program when I store it in a database
<p> I wo wo wo wo wo wo wo </ p>
<p> I wo wo wo wo wo wo wo </ p>
<p> I wo wo wo wo wo wo wo </ p>
<p> I wo wo wo wo wo wo wo </ p>

I can't think of it
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-5-12 13:15:01
| Show all posts
string str = @ "Wo Wo Wo Wo Wo Wo Wo </br>
Wowowowowowowowo </br>
Wowowowowowowowo </br>
Wowowowowowowowo </br>
";
str = System.Text.RegularExpressions.Regex.Replace (str, "(. *?) </br>", "<p> $ 1 </ p>");
Response.Write (str);
Reply

Use magic Report

0

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-5-12 20:45:01
| Show all posts
title = title.Replace ("</br>", "<p>");
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 South Africa

Post time: 2020-5-12 23:00:02
| Show all posts
Read all the data, then use String.Replace (), or replace it with a regular expression!
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-5-14 11:00:03
| Show all posts
If you replace it, you can only replace it with <p>, how do you get this </ p>?
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