工作总结 string类型保存 "" 这种类型

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            //DateTime st = new DateTime(2018, 5, 6, 20, 24, 24);
            //Console.WriteLine(st);
            //Console.WriteLine(st.ToString("yyyy:MM:dd,hh:mm:ss"));
            //Console.WriteLine(st.ToString("yyyy:MM:dd,HH:mm:ss"));

            string sds1 = @"IFERROR(IF(Z{0}-J{0}=0,"",(Z{0}-J{0})+(Z{0}<J{0})),"")";
            //之前这样写 不对的  "" 它只会输出一个“
            Console.WriteLine(sds1);
            //输出两个 要写  """"
            string sds = @"IFERROR(IF(Z{0}-J{0}=0,"""",(Z{0}-J{0})+(Z{0}<J{0})),"""")";
            Console.WriteLine(sds);
            sds = string.Format(sds, (3 + 1));
            Console.WriteLine(sds);
            //@ 中 ""         @"""   会报错         @""""        \"  只输出一个 "
            string ssss = @"""";
            Console.WriteLine(ssss);
            //sds = string.Format(forat, (data4 + 1));



        }
    }
}

 

 

posted @ 2018-08-23 14:43  ~雨落忧伤~  阅读(117)  评论(0编辑  收藏  举报