Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

i have one string, and i assign the value like,

string str="admin" + @"" + "user";

The output of the "str" value comes as

"admin\user"

. But i need "str" value as

"adminuser"

. That means i need single "" symbol instead of "" within the string values. How can i get this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
640 views
Welcome To Ask or Share your Answers For Others

1 Answer

The output of the "str" value comes as "admin\user"

No, it really doesn't. The string itself will just have a single backslash.

If you look at it in the debugger you will see the escaping, but that doesn't mean it's part of the string. It's just the debugger representation. Print it to the console, or log etc to see the real value.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...