Visual Studio 2010中的排序数组 [英] sorting array in visual studio 2010

查看:127
本文介绍了Visual Studio 2010中的排序数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问我正在考虑在Visual Studio 2010中编写程序.但是在执行该程序时遇到了困难.任何人都可以帮助我

please i am thinking of writing a program in visual studio 2010. but am having difficulties in how to go about it. anyone please help me out

推荐答案

有关阅读教程的信息: "Visual Basic 2010教程" [ ^ ] ?
What about reading a tutorial: "Visual Basic 2010 Tutorial"[^]?


您好,

您可以使用以下代码:
Hello,

You can use the following code:
string[] str = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
           str = str.OrderBy(asc => asc).ToArray();

           foreach (string s in str)
           {
               Console.WriteLine(s);
           }


使用Array.Sort方法.在此处查看MSDN文档.

http://msdn.microsoft.com/zh-CN /library/system.array.sort(v=vs.100).aspx [
Use the Array.Sort method. Look at MSDN documentation here.

http://msdn.microsoft.com/en-us/library/system.array.sort(v=vs.100).aspx[^]


这篇关于Visual Studio 2010中的排序数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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