What is the difference between String and StringBuilder?

Both String and StringBuilder are classes used to handle strings.

The most common operation with a string is concatenation. This activity has to be performed very efficiently. When we use the “String” object to concatenate two strings, the first string is combined to the other string by creating a new copy in the memory as a string object, and then the old string is deleted. This process is a little long. Hence we say “Strings are immutable”.

When we make use of the “StringBuilder” object, the Append method is used. This means, an insertion is done on the existing string. Operation on StringBuilder object is faster than String operations, as the copy is done to the same location. Usage of StringBuilder is more efficient in case large amounts of string manipulations have to be performed.

Is String a Reference Type or Value Type in .NET?

String is a Reference Type object.

How do I convert a numeric type to a string?

Call Sytem.Object.ToString(). For example, if the variable count is an integer, write the following:
string text = count.ToString();

What is the meaning of immutable?

immutable means we can not change the contents at run time, example of immutable is String.

Is string reference type / value type?

string is reference type
because String is immutable objects.
means does not change the values(string).

What data type does the RangeValidator control support in Asp.net?

There are 3 Data type RangeValidator control support


Can you programmatically store and retrieve data from ViewState?

Yes, you can programmatically store and retrieve data from ViewState in an ASP.NET application.

Example: To save the value in ViewState object
ViewState("Name") = txtName.text;

Retrieve the value from ViewState object
String strName = ViewState("Name").ToString();