IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
replace_underscores.m
Go to the documentation of this file.
1 %>@ingroup string
2 %> @file
3 %> @brief Replaces underscores with a '-'
4 %>
5 %> @param s string of cell of strings
6 %> @return a string, if the input is a string, or a cell of strings, if the input is a cell of strings
7 function s = replace_underscores(s)
8 flag_cell = iscell(s);
9 if ~flag_cell
10  s = {s};
11 end;
12 
13 for i = 1:numel(s)
14  s{i}(s{i} == '_') = '-';
15 end;
16 
17 if ~flag_cell
18  s = s{1};
19 end;
function replace_underscores(in s)