Skip to content

Commit 002c880

Browse files
committed
[octave] loadyaml and saveyaml support octave
1 parent 4f851df commit 002c880

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

saveyaml.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
lines = cell(1, len);
168168
for i = 1:len
169169
lines{i} = obj2yaml('', item{i}, level + 1, varargin{:});
170-
if (~startsWith(strtrim(lines{i}), '-'))
170+
if (isempty(regexp(strtrim(lines{i}), '^-', 'once')))
171171
lines{i} = sprintf('%s- %s', repmat(' ', 1, (level + 1) * opt.indent), strtrim(lines{i}));
172172
end
173173
end
@@ -176,7 +176,7 @@
176176
lines = cell(1, len);
177177
for i = 1:len
178178
lines{i} = obj2yaml('', item{i}, level, varargin{:});
179-
if (~startsWith(strtrim(lines{i}), '-'))
179+
if (isempty(regexp(strtrim(lines{i}), '^-', 'once')))
180180
lines{i} = sprintf('%s- %s', repmat(' ', 1, level * opt.indent), strtrim(lines{i}));
181181
end
182182
end

0 commit comments

Comments
 (0)