Want to build the ChatGPT based Apps? Start here
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
harish reddy
2k
162
26.2k
String buider . Append
Mar 28 2018 11:32 PM
I am not getting the output and i am getting the arugument out of range exception for the same.
//Write a program that reads a string from the console (20 characters maximum) and if shorter complements it right with "*" to 20 characters.
StringBuilder first = new StringBuilder(50);
string input = Console.ReadLine();
if (input.Length<=20)
{
first.Append(input);
Console.WriteLine(first);
first.Append("x", (input.Length + 1), (20 - input.Length-1));
}
Console.WriteLine(first);
My input is : Harish
Expected output is : HARISHXXXXXXXXXXXXXX
Reply
Answers (
2
)
Visual studio 2015 debugging multiple solutions
How to invoke script and html in wpf without using web brows