Answers for "tostring c#"

C#
0

tostring c#

object exampleObject = "hello";
Console.WriteLine(exampleObject.ToString()); //console -> "hello"

string dateTime;
dateTime = DateTime.Now.ToString(); //without .ToString(), editor will return an error
Console.WriteLine(dateTime); //console -> "10/13/2021 19:03:16"
Posted by: Guest on October-13-2021

C# Answers by Framework

Browse Popular Code Answers by Language