duck

DuckTools HasWord

Mar 20th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.32 KB | None | 0 0
  1.    
  2.     // helper function, used to identify imported objects by naming convention
  3.     public static bool HasWord (string hayStack, string needle)
  4.     {
  5.         string[] words = hayStack.Split (' ');
  6.         foreach (string word in words) {
  7.             if (word.ToLower () == needle.ToLower ()) {
  8.                 return true;
  9.             }
  10.         }
  11.         return false;
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment