日期:2014-05-17 浏览次数:21442 次
string[] s1 = { "a", "b", "c", "d", "e", "f", "h", "ab", "bc", "abf", "eh", "bh", "bcf", "ch" };
string[] arr = s1.Where((n, index) => index > 0 && index < 10).ToArray();
将arr转为字符串就行了
            string s = string.Join("", s1.Skip(1).Take(9).ToArray());
string[] s1 = { "a", "b", "c", "d", "e", "f", "h", "ab", "bc", "abf", "eh", "bh", "bcf", "ch" };
            StringBuilder sb = new StringBuilder();
            int i = 2;
            while (i <= 10)
            {
                sb.Append(s1[i]);
                i++;
            }
            Console.WriteLine(sb.ToString());

static class Program
{
static void Main()
{
string[] s1 = { "a", "b", "c", "d", "e", "f", "h", "ab", "bc", "abf", "eh", "bh", "bcf", "ch" };
string ss = string.Join("", s1, 1, 5);
Console.WriteLine(ss);