The requirements are not clear with respect to trimming the criteria, so I guess
you should just do what feels right to you. In my implementation I chose not to trim the criteria, because that might yield unwanted results for the user, consider the following case:
Criteria: "Air "
Data set:
[1] - "Air"
[2] - "Airfield"
[3] - "Air Miles"
With the given criteria the user expects to only find [3], but if you trim the criteria you would also get [1] & [2], because the both begin with "Air".