function s2=s_pad(s1,n);
%	Set string length (pad or truncate).
%
%	[s2]=s_pad(s1,n);

%	Latest revision by P. Dragos 7-Jun-91.
%
%	P. Dragos, Battelle Ocean Sciences
%	Duxbury, MA 02332
%	(617) 934-0571
%
%	Copyright (c) 1991 by Paul Dragos.
%	This program is copyrighted.  However, you are encouraged to
%	copy and share it, so long as no charge is imposed.

if (nargin < 2), n=78;, end;
len=length(s1);
if (len < n),
  s2=[s1 blanks(n-len)];
elseif (len > n),
  s2=s1(1:n);
else 
  s2=s1;
end;
return;
