.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

How do I convert a numeric type to a string?

Posted By :Shashi Ray     Posted Date :March 30, 2009    Points :10   Category :ASP.Net 
Call Sytem.Object.ToString(). For example, if the variable count is an integer, write the following:
string text = count.ToString();

You can also find related Interview Question to How do I convert a numeric type to a string?  below: 

How do you declare a Numeric type to String?

  
Call System.Object.Tostring()
For Example
int idx =0;
string str - idx.ToString();
(More...)

How do you declare a Numeric type to String?

  
Call System.Object.Tostring()
For Example
int idx =0;
string str - idx.ToString(); (More...)

convert a value-type to a reference type is known as?

  
Boxing.

Boxing is the terminology used in .NET Framework to convert Value type to reference type (More...)

convert a Reference Type to a Value type is known as?

  
UnBoxing.

UnBoxing is the terminology used in .NET Framework to convert Reference Type to a Value type (More...)

Is string reference type / value type?

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

Why string are called Immutable data Type ?

  
The memory representation of string is an Array of Characters, So on re-assigning the new array of Char is formed & the start address is changed . Thus keeping the Old string in Memory for Garbage Collector to be disposed. (More...)

Why string are called Immutable data Type ?

  
The memory representation of string is an Array of Characters, So on re-assigning the new array of Char is formed & the start address is changed . Thus keeping the Old string in Memory for Garbage Collector to be disposed. (More...)

What is Difference Between ToString() vs Convert.ToString() vs (string) cast

  
There is a simple but important difference between these three.

ToString() raise exception when the object is null

So in the case of object.ToString(), if object is null, it raise NullReferenceException.

Convert.ToString() return string.Empty in case of null object

(string) cast assign the object in case of null

So in case of
MyObject o = (string)NullObject;

But when you use o to access any property, it will raise NullReferenceException.
(More...)

Is String a primitive type?

  
No, the string is not a primitive type.
However, it has some characteristics common with the primitive types.
The language supports string literals in the code, so that you don't have to explicitly create Stringinstances using the new keyword to get a string object.
There is also support for concatenating strings using the + operator, which the compiler turns into a call to the String.Concat method.
Strings are immutable, which means that it in most situations has value type semantics, just like the primitive types.
(More...)

How To Convert String to Integer in vb script or Numberformat.

  
Normally We Can Convert String To Integer using some Built-in Function.

1.CInt
2.Clng (More...)

What is the difference between convert.to.string and .to.string() method?

  
Convert function handles nulls while i.string() does not it will throw a null reference exception error. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend