Program to Print String in Double Inverted Comma (") in C#

This is a console program to accept a string and print it with double inverted comma.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace hello

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("Enter a string");

            string str = Console.ReadLine();

            Program pbj = new Program();

            str = pbj.convertto_inverted(str);

            Console.WriteLine(str);

            Console.ReadKey();

        }

        public string convertto_inverted(string str)

        {

            string comma = "";

            comma = "\"" + str + "\"";

            return comma;

        }

    }

}

Ebook Download
View all
Learn
View all