c#:转义字符及Unicode值

任务描述

使用转义字符,按照要求输出完整的格式。 例如,将下面一段话完整输出:

  • "Exams decide all your life" is one of my favorite sayingss

可以这样:

  1. Console.Write("\"Exams decide all your life\" is one of my favorite sayingss"):
  2. 编程要求
    下面是一段摘自电影《超凡蜘蛛侠》的对话,

    Ben:"Listen to me, son"
    Peter:"Yeah, go ahead"
    Ben:"You are a lot like your father, Peter"
    Ben:"But your father believed that if you could do good things for other people,
    you had a moral obligation to do those things"
    Ben:"Not choice. Responsibility"
    Peter:"That is nice. That’s great"
    现给出具体要求如下:

    使用转义字符相关知识,按格式完整输出
    可以使用不同的转义字符或输出函数
    在右侧Begin至End中间的补全代码

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;

    namespace B3

    {

        class b3

        {

            static void Main(string[] args)

            {

                /********** Begin *********/

                //请运用转义字符相关知识

                //按照任务要求将一段文字完整打印出来

            string abc = "Ben:\"Listen to me, son\"";

            string abd = "Peter:\"Yeah, go ahead\"";

            string acd= "Ben:\"You are a lot like your father, Peter\"";

            string adb= "Ben:\"But your father believed that if you could do good things for other people, you had a moral obligation to do those things\"";

            string efg = "Ben:\"Not choice. Responsibility\"";

            string fth= "Peter:\"That is nice. That’s great\"";

            Console.WriteLine(abc);

            Console.WriteLine(abd);

            Console.WriteLine(acd);

            Console.WriteLine(adb);

            Console.WriteLine(efg);

            Console.WriteLine(fth);

                /********** End *********/            

            }

           

        }

    }

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值