/* Removes (trims) specified leading and trailing characters from a string. */
VOID IScsiStrTrim(IN OUT CHAR16 *Str, IN CHAR16 CharC)
/* Removes (trims) specified leading and trailing characters from a string. */
VOID IScsiStrTrim(IN OUT CHAR16 *Str, IN CHAR16 CharC)
{
  CHAR16  *Pointer1;
  CHAR16  *Pointer2;
  if (*Str == 0) {
    return;
  }
  for (Pointer1 = Str; (*Pointer1 != 0) && (*Pointer1 == CharC); Pointer1++) {
  }
  Pointer2 = Str;
  if (Pointer2 == Pointer1) {
    while (*Pointer1 != 0) {
      Pointer2++;
      Pointer1++;
    }
  } else {
    while (*Pointer1 != 0) {
      *Pointer2 = *Pointer1;
      Pointer1++;
      Pointer2++;
    }
    *Pointer2 = 0;
  }
  for (Pointer1 = Str + StrLen (Str) - 1; Pointer1 >= Str && *Pointer1 == CharC; Pointer1--) {
  }
  if (Pointer1 !=  Str + StrLen (Str) - 1) {
    *(Pointer1 + 1) = 0;
  }
}