C#基础(三十三) Find() 和FindIndex()的用法:找出知足集合List特定条件的字符。

参考;http://www.javashuo.com/article/p-xptjeagj-hr.html.spa

其中,xxx是随机起的名字。 .net

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QueueSample
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = "你aabbbfjalj444我";
            List<char> StringList = new List<char>();
            StringList = str.ToList();
            Console.WriteLine(str);
            Console.WriteLine(StringList[0].ToString());
            Console.WriteLine(StringList[0]);

            int a = StringList.Find(xxx => xxx.Equals( '我'));
            int b = StringList.FindIndex(xxx => xxx.Equals('我'));
            Console.ReadLine();
        }
    }
}