| |

VerySource

 Forgot password?
 Register
Search
View: 973|Reply: 9

How do I escape this line?

[Copy link]

2

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-1 13:00:01
| Show all posts |Read mode
The original statement:
sb.Append ("<a href="fdsfds" title="gfsdf" onmouseover="tip(this)" onmouseout="document.all.pop.style.display='none'"> fdsfds </a>")
How do I escape this line?
<a href="fdsfds" title="gfsdf" onmouseover="tip(this)" onmouseout="document.all.pop.style.display='none'"> fdsfds </a>
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-13 19:00:01
| Show all posts
Preceded by @, replaced by "
Reply

Use magic Report

0

Threads

38

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 China

Post time: 2020-3-14 09:30:01
| Show all posts
@ "<a href=""fdsfds"" title=""gfsdf"" onmouseover=""tip(this)"" onmouseout=""document.all.pop.style.display='none'""> fdsfds < / a> "
Reply

Use magic Report

0

Threads

5

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-18 20:45:01
| Show all posts
@This will do.
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-3-19 15:15:01
| Show all posts
All double quotes with backslash
<a href=\"fdsfds\" title=\"gfsdf\" onmouseover=\"tip(this)\" onmouseout=\"document.all.pop.style.display='none'\"> fdsfds </a>
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-19 19:15:01
| Show all posts
sb.Append (@ "<a href="fdsfds" title="gfsdf" onmouseover="tip(this)" onmouseout="document.all.pop.style.display='none'"> fdsfds </a>" )
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-3-21 13:45:02
| Show all posts
There is a problem upstairs, @ can not escape double quotes, if there must be double quotes in the string, you cannot use @
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-22 02:00:02
| Show all posts
sb.Append ("<a href = 'fdsfds' title = 'gfsdf' onmouseover = 'tip (this)'
onmouseout = 'document.all.pop.style.display =\"none\"'> fdsfds </a> ")

or

sb.Append ("<a href=\"fdsfds\" title=\"gfsdf\" onmouseover=\"tip(this)\" onmouseout=\"document.all.pop.style.display='none'\"> fdsfds </a> ")
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-3-22 11:45:01
| Show all posts
sb.Append (@ "<a href =" "fdsfds" "title =" "gfsdf" "onmouseover =" "tip (this)" "onmouseout =" "document.all.pop.style.display = 'none'" "> fdsfds </a>");

or:
sb.Append ("<a href=\"fdsfds\" title=\"gfsdf\" onmouseover=\"tip(this)\" onmouseout=\"document.all.pop.style.display='none'\"> fdsfds </a> ");
Reply

Use magic Report

0

Threads

14

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-3-25 09:15:01
| Show all posts
Strings enclosed in @ begin with @ and are enclosed in double quotes. E.g:

Vs help: ms-help: //MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/csref/html/vclrfString.htm

@ "good morning" // a string literal
The advantage of using @ is that the escape sequence is "not" processed, so you can easily write out a string, such as a fully qualified file name:

@ "c:\Docs\Source\a.txt" // rather than "c:\\Docs\\Source\\a.txt"
To include a double quote in a string enclosed in @, use two pairs of double quotes:

@ "" "Ahoy!" "Cried the captain." // "Ahoy!" Cried the captain.
Another use of the @ symbol is to use a referenced (/ reference) identifier that happens to be a C # keyword.
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