控制台使用CAPS进行用户输入 [英] Console use CAPS for user input

查看:92
本文介绍了控制台使用CAPS进行用户输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#(我仍在学习)作为控制台应用程序创建一个Tic Tac Toe游戏.我想知道是否可以将用户输入从x更改为大写X,因为它看起来更好.

I'm creating a Tic Tac Toe game as a console application using C# (which I am still learning). I want to know if it is possible to change the user input from an x to a capital X because it looks better.

推荐答案

您可以使用

.ToUpper();

编辑-要在控制台窗口中更改它,我将改用它:

EDIT - To change it in the console window I'd use this instead:

Console.ReadKey(false)

将从控制台窗口中隐藏所按下的键,然后您可以用大写字母自己编写.

will hide the pressed key from the console window, then you can write it yourself in capitals.

http://msdn.microsoft.com/en-us/library/x3h8xffw.aspx

这篇关于控制台使用CAPS进行用户输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆