NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/strfun/blank.m

Revision 495 (checked in by cbc, 11 years ago)

Initial import of Stark code.

Line 
1 %
2 % outstr=blank(instr)
3 %
4 % BLANK returns the non-whitespace portion in the input string instr
5 %
6 % Calls: none
7 %
8 function outstr=blank(instr)
9
10 [m,n]=size(instr);
11 if m>1
12    error('input string must be a vector');
13 end
14
15 % REMOVE LEADING BLANKS
16 %
17 [m,n]=size(instr);
18 count=0;
19
20 spaces=find(instr==' ');
21 instr(spaces)='';
22
23 outstr=instr;
24
25 return;
Note: See TracBrowser for help on using the browser.