c# console move string
2013-11-13 18:54
429 查看
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Yellow; int m = 0; int n = 0; Console.Write("zxl"); do { switch (Console.ReadKey(true).Key) { case ConsoleKey.UpArrow: n = n - 1; break; case ConsoleKey.DownArrow: n = n + 1; break; case ConsoleKey.LeftArrow: m = m - 1; break; case ConsoleKey.RightArrow: m = m + 1; break; } Console.Clear(); string aa = ""; string bb = ""; for (int a = 0; a < m; a++) { aa += " "; } for (int b = 0; b < n; b++) { bb += "\n"; } Console.Write(bb + aa + "zxl"); } while (true); } } }
相关文章推荐
- C#控制台基础 console.writeline中写加号为何能连接多个字符串之string.concat
- Interview Q&A - Write a C# console application to implement a string replacement function
- c#: 为 Console 应用程序(控制台应用程序)的 main 函数提供参数(string[] args)的方法
- c# string Rmove Substring Replace
- C#判断一个string是否为数字(正则表达式)
- c# 日期函数[string.Format----GetDateTimeFormats]格式
- C#回顾学习笔记二十六:String与StringBuilder的区别
- C# Dictionary<string, int>
- C# Byte数组转换String解决方案
- C#学习笔记5-string和String
- C#中关于String.Equals(object,object)和(object==object )的比较
- C#基础-语句、运算符、表达式、String、StringBuilder和字符串编码(Day3)
- 全面剖析C#之String对象
- C#:String.Format数字格式化输出
- C# byte[]类型和String类型相互转换
- c# .net 如何把byte类型仅仅转换成string而不改变其内容
- C# String.IndexOfAny 方法 (Char[])
- Convert string to object (c#)
- C#截取字符串(String.Substring方法)
- C#中null,"",string.Empty的区别