How to add non escape double quotes before and after substring variable value in C#

1 Answer

0 votes
using System;
using System.Text;

namespace ConsoleApplication_C_Sharp
{
    static class Program
    {
        static void Main()
        {
            StringBuilder sb = new StringBuilder();
            string s = "java";

            sb.Append("c# ");
            sb.Append('"' + s + '"');
            sb.Append(" php c++");

            string lang = sb.ToString();

            Console.WriteLine(lang);
        }
    }
}


/*
run:
  
c# "java" php c++
   
*/

 



answered Oct 15, 2018 by avibootz

Related questions

2 answers 196 views
2 answers 254 views
1 answer 79 views
2 answers 304 views
304 views asked Oct 14, 2018 by avibootz
1 answer 118 views
...