Possible Duplicate:
C#: why does the string type have a .ToString() method
Why is there a ToString method exist in String class (VB.NET)?
String.ToString()
Will it be a overhead if it is used like
TextBox.Text.ToString()
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
ToStringmethod is found onObjectfrom whichStringinherits. The implementation ofObject.ToStringis to print the typename.The type
Stringoverrides this method to return itself.The code
TextBox.Text.ToString()has an unnecessary call toToString, but it is unlikely that there will be any noticable performance impact from doing so.