TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
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
Forums
Monthly Leaders
Forum guidelines
harish reddy
NA
162
33.4k
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