function nameout=sb2slbnm(namein);
% SB2SLBNM truncates valid characters from a user name.

% Copyright (c) 1990-93 by The MathWorks, Inc.
% $Revision: 1.5 $  $Date: 1993/06/09 22:09:40 $

app_ind = find(namein == '/');
if isempty(app_ind)
   app_ind = 0;
end;
app=namein(app_ind(length(app_ind)):length(namein));
app_ind = find(((app >= 48) & (app <=57)) | ...
	((app >= 65) & (app <=90)) | ...
	((app >= 97) & (app <=122)));
app = app(app_ind);
if length(app) > 8
  app= app(1:8)
end;
nameout = ['_' app];
