diff scripts/pkg/pkg.m @ 8877:2c8b2399247b

implement strsplit; deprecate split
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 26 Feb 2009 10:29:59 +0100
parents 34a821854961
children 63ad1133d0ed
line wrap: on
line diff
--- a/scripts/pkg/pkg.m
+++ b/scripts/pkg/pkg.m
@@ -1754,12 +1754,7 @@
 ## Split the text into a cell array of strings by sep.
 ## Example: "A, B" => {"A", "B"} (with sep = ",")
 function out = split_by (text, sep)
-  text_matrix = split (text, sep);
-  num_words = size (text_matrix, 1);
-  out = cell (num_words, 1);
-  for i = 1:num_words
-    out{i} = strip (text_matrix(i, :));
-  endfor
+  out = strtrim (strsplit (text, sep));
 endfunction
 
 ## Create an INDEX file for a package that doesn't provide one.