/* Cleans off leading and trailing spaces and tabs. */
STATIC EFI_STATUS TrimSpaces(IN CHAR16 *String)
/* Cleans off leading and trailing spaces and tabs. */
STATIC EFI_STATUS TrimSpaces(IN CHAR16 *String)
{
  CHAR16  *Str;
  UINTN   Len;
  ASSERT (String != NULL);
  if (String == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Str = String;
  while (*Str == L' ' || *Str == L'\t') {
    Str++;
  }
  do {
    Len = StrLen (Str);
    if (!Len || ((Str[Len - 1] != L' ') && (Str[Len - 1] != '\t'))) {
      break;
    }
    Str[Len - 1] = CHAR_NULL;
  } while (Len);
  CopyMem (String, Str, StrSize (Str));
  return EFI_SUCCESS;
}