The reason why I'm stripping leading and trailing spaces from search string is:

1. We are passing data like: ` test` (space at start of string). Similarly `test ` (space at end of string).
Now UI automatically handles the leading/trailing spaces  while entering to name field. It means UI will create entity with name `test` ( no leading/traling spaces). 

2. Now once the entity is created and you will search it via given string `test `, UI won't perform search since there is no entity which starts with space as its already stripped while creation.

3. so we need to strip the leading and trailing spaces from string while performing search and I think space escaping doesn't work in this case as we wanted to remove them.