C# Programming - Strings - Discussion
Discussion Forum : Strings - General Questions (Q.No. 8)
8.
Which of the following snippets are the correct way to convert a Single into a String?
Single f = 9.8f; String s; s = (String) (f);
Single f = 9.8f; String s; s = Convert.ToString(f);
Single f = 9.8f; String s; s = f.ToString();
Single f = 9.8f; String s; s = Clnt(f);
Single f = 9.8f; String s; s = CString(f);
Discussion:
2 comments Page 1 of 1.
Santhosh said:
10 years ago
Can you please explain this?
Naga said:
9 years ago
Both are same convert. Tostring is not allow null values, f.Tostring is allow null values.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers