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
Maha
NA
0
325.1k
StringBuilder/string
Jul 31 2013 1:50 PM
When s2 data type is
StringBuilder
no need for ToString() method but when s3 data type is
string
there is need for ToString() method. Is there any explanation for this? Problem is highlighted.
using System;
using System.Text;
class Program
{
static void Main(string[] args)
{
string s1 = "string1 ";
StringBuilder s2 = new StringBuilder("string1 ").Append(s1);
Console.WriteLine(s2);//string1 string1
string s3 = new StringBuilder("string1 ").Append(s1).
ToString
();
Console.WriteLine(s3);//string1 string1
Console.ReadKey();
}
}
Reply
Answers (
2
)
How to generate a proxy using AddServiceReference in WCF?
Define Default language in textbox