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
Patrick Gareau
NA
14
469
Help me understand some code
Mar 4 2019 4:52 PM
using System;
using System.Text;
namespace forgetCode{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Enter the string to reverse :");
string name = Console.ReadLine();
StringBuilder builder = new StringBuilder();
for (int i = name.Length - 1; i >= 0; i--)
{
builder.Append(name[i]);
}
string newName =builder.ToString();
Console.WriteLine(newName);
}
}}
Can someone please explain how this code reverses a string and why would you use stringbuilder over string?
Reply
Answers (
3
)
Upload File on SFTP Server Using Asp.Net
Message Box Problem Please Help!!