Skip to content

Instantly share code, notes, and snippets.

@atiq-cs
Created October 23, 2017 04:10
Show Gist options
  • Save atiq-cs/a4c32df3fe0de76bc08295ce5ad461f3 to your computer and use it in GitHub Desktop.
Save atiq-cs/a4c32df3fe0de76bc08295ce5ad461f3 to your computer and use it in GitHub Desktop.
a test from wiziq.com - secocnd question
/* Question 2 of a C# Test
http://www.wiziq.com/online-tests/14096-csharp-your-skills-1
ref Convert.ToString:
https://msdn.microsoft.com/en-us/library/astxcyeh(v=vs.110).aspx
Quote:
Return Value
Type: System.String
The string representation of value, or String.Empty if value is an object
whose value is null. If value is null, the method returns null.
Object.ToString() : System.NullReferenceException
*/
using System;
using System.Collections.Generic;
class Solution {
static void Main(string[] args) {
object obj = null;
string strobj = obj.ToString();
string objstr = Convert.ToString(obj);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment