IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
good_filename.m
Go to the documentation of this file.
1 %>@ingroup ioio string
2 %>@file
3 %>brief Replaces invalid characters in name with an underscore ('_')
4 %
5 %> @param name Input name
6 function name = good_filename(name)
7 len = size(name, 2);
8 for i = 1:len
9  ch = name(i);
10  if sum(ch == [65:65+25 97:97+25 48:48+9]) == 0 && sum(ch == ['_-()[].']) == 0
11  name(i) = '_';
12  end;
13 end;
14 
function good_filename(in name)