function [y,arg]=idcmp(str,id)
% IDCMP	Test whether a string starts with a specified identifier
%	y=idcmp(str,id) tests whether the string str starts with the string
%	id (ignoring case). If it does a nonzero is returned.
%	
%	[y,arg]=idcmp(str,id) returns the last part of str in arg if str
%	contains more characters than id. 

arg='';
if length(str) >= length(id)
  y=strcmp(lower(str(1:length(id))),lower(id));
  if length(str) > length(id)
    arg=str(length(id)+1:length(str));
  end
else
  y=0;
end

