C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How To Print Double Inverted Comma (") in C#
WhatsApp
Pankaj Pandey
6y
16.3
k
0
4
25
Blog
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;
}
}
}
People also reading
Membership not found