Why String.ToString()?
.net, vb.net
Solution
The `ToString` method is found on `Object` from which `String` inherits. The implementation of `Object.ToString` is to print the typename.
public virtual string ToString() {
return this.GetType().ToString();
}
The type `String` overrides this method to return itself.
public override string ToString() {
return this;
}
The code `TextBox.Text.ToString()` has an unnecessary call to `ToString`, but it is unlikely that there will be any noticable performance impact from doing so.
Problem
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() ```