Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

Below are a few helper functions for List<string> generic class.

They could be modified to be extension methods.

 

   //See also StringArrayHelper.cs, CollectionsHelper.cs

        public static class ListOfStringsHelper

        {

            public static bool StringContainsAnyFromList(List<string> patternsList, string sMsg)

            {

                bool bFound = patternsList.Exists(

                    delegate(string pattern)

                    {

                        return sMsg.Contains(pattern);

                    }

                    );

                return bFound;

            }

            public static string FindFirstListItemContainedInString(List<string> patternsList, string sMsg)

            {

                string sFound = patternsList.Find(

                    delegate(string pattern)

                    {

                        return sMsg.Contains(pattern);

                    }

                   );

                return sFound;

            }

        }

 

Se also My StringHelper class 

Posted on Friday, December 12, 2008 10:39 PM .Net Framework | Back to top


Comments on this post: Helper functions to find pattern contaned in string from pattern List

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net