📜  tostring c#代码示例

📅  最后修改于: 2022-03-11 14:49:11.150000             🧑  作者: Mango

代码示例1
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"