/[MITgcm]/MITgcm_contrib/enderton/Diagnostics/DiagUtility/AddSlashesBeforeUnderscores.m
ViewVC logotype

Contents of /MITgcm_contrib/enderton/Diagnostics/DiagUtility/AddSlashesBeforeUnderscores.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon Jan 31 15:43:28 2005 UTC (20 years, 6 months ago) by enderton
Branch: MAIN
CVS Tags: HEAD
 o Initial check in.

1 function string = AddSlashesBeforeUnderscores(str)
2
3 index = find(str == '_');
4
5 if ~isempty(index)
6 string = '';
7 for ichar = 1:length(index)
8
9 if ichar == 1
10 i = 1;
11 else
12 i = index(ichar-1);
13 end
14
15 string = [string,str(i:index(ichar)-1),'\'];
16 end
17
18 string = [string,str(index(ichar):end)];
19
20 else
21 string = str;
22
23 end

  ViewVC Help
Powered by ViewVC 1.1.22