Morning folks,
I have an ASP.Net C# page that pulls in a list of servers from a SQL box and displays the list of servers in a label. ("srv1,srv2,srv3"). I need to add double quotes around each of the servers names. ("srv1","srv2","srv3",)
Any help would be greatly appreached.
2
Answers
As far as I can understand, you are trying to use double quotes in a string.
If you want to use such,
you can use escape character:
for the sake of simplicity, you can even convert it to a function:
Also, if you have already "srv1,srv2,srv3" format, find ‘,’ characters in the string and add " before and after comma. Also, notice that you should add to first index and last index ".
If you have string
Then you can simply do
Now
str
contains"srv1","srv2","srv3"