function value = s_neqi ( s1, s2 )

%*****************************************************************************80
%
%% s_neqi is TRUE if two strings are not equal.
%
%  Discussion:
%
%    The comparison ignores case and trailing blanks.
%
%    S_NEQI ( 'Anjana', 'ANJANA' ) is FALSE.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 May 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    string S1, S2, the strings to compare.
%
%  Output:
%
%    logical VALUE, the result of the comparison.
%
  len1 = length ( s1 );
  len2 = length ( s2 );
  lenc = min ( len1, len2 );

  value = true;

  for i = 1 : lenc

    c1 = upper ( s1(i) );
    c2 = upper ( s2(i) );

    if ( c1 ~= c2 )
      value = true;
      return
    end

  end

  for i = lenc + 1 : len1
    if ( s1(i) ~= ' ' )
      value = true;
      return
    end
  end

  for i = lenc + 1 : len2
    if ( s2(i) ~= ' ' )
      value = true;
      return
    end
  end

  value = false;

  return
end
