你可以设置一个变量为console.ReadLIne()?(Can you set a variable to console.ReadLIne()?)

编程入门 行业动态 更新时间:2024-10-27 10:28:00
你可以设置一个变量为console.ReadLIne()?(Can you set a variable to console.ReadLIne()?)

我是新手编程的人。 这是我一直在思考的问题。 你可以在c#中设置一个变量为Console.ReadLine(),然后调用变量而不是每次输入Console.ReadLine()。 例如:

//Set Variable var read = Console.ReadLine(); //Call vaariable read;

I am new to programming here. This is a question that i have been mulling over. Can you set a variable to Console.ReadLine() in c# and then call the variable instead of typing Console.ReadLine() everytime? For example:

//Set Variable var read = Console.ReadLine(); //Call vaariable read;

最满意答案

喜欢这个:

//Set Variable Func<string> read = Console.ReadLine; //Call vaariable read();

Like this:

//Set Variable Func<string> read = Console.ReadLine; //Call vaariable read();

更多推荐

本文发布于:2023-08-07 18:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465922.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:你可以   量为   console   variable   set

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!