¿ìËÙÒµÎñͨµÀ

LINQѧϰ±Ê¼Ç:½á¹¹»¯ÇÒÀàÐÍ°²È«µÄ²éѯ

×÷Õß ØýÃû¼¼Êõ À´Ô´ NET±à³Ì ä¯ÀÀ ·¢²¼Ê±¼ä 2012-03-13

ͨ¹ýеĹؼü×Övar, ÎÒÃÇ»¹¿ÉÒÔʹ²éѯÓï¾ä¸ü¼ò¶ÌһЩ:

var filteredNames = names.Where(n => n.Length > = 4);

´ó¶àÊýµÄ²éѯ²Ù×÷·½·¨¶¼½ÓÊÜÒ»¸öLambda±í´ïʽ×÷ΪÊäÈë²ÎÊý, Lamdba±í´ïʽÓÃÓÚÖ¸µ¼ºÍËÜÔì²éѯ, n => n.Length >= 4¾ÍÊÇÎÒÃÇÉÏÊö·½·¨ÖÐÓõ½µÄLamdba±í´ïʽ. ÊäÈë²ÎÊý½«»áÏìÓ¦µ½Ã¿Ò»¸öÔªËØ, ÔÚÕâ¸öÀý×ÓÖÐ, ÊäÈë²ÎÊýn´ú±íÔÚÊý×éÖеÄÿһ¸öÔªËØ, ²¢ÇÒËüµÄÀàÐÍÊÇstring. Where²Ù×÷·½·¨ÒªÇóLambda±í´ïʽ·µ»ØÒ»¸öboolÖµ, Èç¹û·µ»Øtrue, ±íʾ¸ÃÔªËؽ«±»°üº¬½øÊä³öÐòÁÐÖÐ.

ÁíÍâÔÚC#µ±Öл¹¶¨ÒåÁËÒ»ÖÖÌØÊâµÄÓï·¨ÓÃÓÚ±àд²éѯ, ³ÉΪ¸´ºÏ²éѯÓï·¨, Ò»¸öÀý×ÓÈçÏÂ:

IEnumerable<string> theName = from n in names where n.Contains(“T”)

select n;

LambdaÓï·¨ºÍ¸´ºÏ²éѯÓï·¨ÊÇ»¥²¹µÄ. ´ýÐø!

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

ÉHTTP/1.1 401 Access Denied ÏÒ»Ò³ech/37268.htm" title="PhotoshopÈëÃÅ:»æÖÆÁ¢ÌåЧ¹û°ÂÔËÎ廷Ч¹ûͼ" target="_blank">PhotoshopÈëÃÅ:»æÖÆÁ¢ÌåЧ¹û°ÂÔËÎ廷Ч¹ûͼ
  • LinuxϵÄVsftpdÅäÖÃƪ
  • DIVºÍtableÒ³Ãæ²¼¾ÖµÄÇø±ðºÍÁªÏµ
  • ÈçºÎʵÏÖ¶þάÏòÁ¿ - ±à³ÌÈëÃÅÍø
  • ÍøÂçÓªÏú¹«Ë¾ÔÚÔËÓªÖеIJßÂÔ
  • iBATIS 3ÄÚµÄÐÂÌØÐÔ£º½«iBATISÓÃ×÷Ó¦ÓóÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø
  • Photoshop»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
  • Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ