Filter out string sections I have a helper method to clean up a string and remove pieces that I will be generating again. (defined by the "SpecialKey" Constants) but I've never been real happy with the code. Although I find it easy to read adding more keys doesn't always seem so clean.

    protected static System.String[] GetStringParts(System.String stringValue)
    {
        System.String[] stringParts = stringValue.Split('!');

        System.Func&lt;System.String, System.Boolean&gt; isConstKey = (System.String key) =&gt;
        {
            return !System.String.IsNullOrWhiteSpace(key) &amp;&amp; (
                    key.StartsWith(MyUtility.SpecialStringKey1) ||
                    key.StartsWith(MyUtility.SpecialStringKey2) ||
                    key.StartsWith(MyUtility.SpecialStringKey3) ||
                    key.StartsWith(MyUtility.SpecialStringKey4)
                );
        };
        return stringParts.Where(key =&gt; !isConstKey(key)).ToArray();
    }


I have removed specific names and such. I don't usually go by the convention SpecialKey1/2 etc

I'd like any pointers on performance or readability. This code gets hit often but in the last two years has only been changed once (maybe twice).
I have a couple of suggestions and observations I'd like to point out:

Fully qualified System types reduce readability without adding information.
So: use string[] instead of System.String[], bool instead of System.Boolean and so on.

Defining a lambda statement and storing it in a variable overcomplicates the code. Use query expression syntax instead.

Are you actually using the return value as a string[] (accessing by index, etc.) or could you get away with returning IEnumerable&lt;string&gt;? (Eric Lippert explains why you should.)

Your isConstKey looks wrong, but it's hard to tell because of the double negative. Are you trying to remove empty strings? Currently, you're leaving the white space in the result, not removing it. In below code sample, I've corrected the problem.

Instead of comparing all the SpecialKeyStrings seperately, put them into a sequence exposed as a property of MyUtility and use LINQ to validate against that:
  public static IEnumerable&lt;string&gt; SpecialStringKeys
  {
      get
      {
          return new[] { SpecialStringKey1, SpecialStringKey2, SpecialStringKey3, 
                         SpecialStringKey4, };
      }
  }



Edit: other possibilities would be to avoid creating a new array every time; you could create a private static readonly ReadOnlyCollection&lt;string&gt; field or just a private static readonly string[].
All that would allow your GetStringParts method to be changed to the following:
protected static IEnumerable&lt;string&gt; GetStringParts(string stringValue)
{
    return from part in stringValue.Split('!')
           where !string.IsNullOrWhiteSpace(part) &amp;&amp; 
                 !MyUtility.SpecialStringKeys.Any(part.StartsWith)
           select part;
}

(If you really need an array, add the ToArray call and change the return type back).
If you want to go one step further in readability, you could extract the condition to an extension method:
public static bool IsNeitherKeyNorWhiteSpace(this string source)
{
    return !string.IsNullOrWhiteSpace(source) &amp;&amp; 
           !MyUtility.SpecialStringKeys.Any(source.StartsWith);
}

Changing your original method thus:
protected static IEnumerable&lt;string&gt; GetStringParts(string stringValue)
{
    return from part in stringValue.Split('!')
           where part.IsNeitherKeyNorWhiteSpace()
           select part;
}