wolffd@0: %function cstr = strsplit(strarr, ch) wolffd@0: % wolffd@0: % FUNCTIONALITY wolffd@0: % Splits string at positions where substring wolffd@0: % occurs. If is not given, then ascii character 10 wolffd@0: % (newline) is the splitting position. wolffd@0: % This would split for example a read-in file into its lines. wolffd@0: % wolffd@0: % INPUT wolffd@0: % strarr string to split wolffd@0: % ch optional, character or substring at which to split, wolffd@0: % default is character ascii 10 = 'newline' wolffd@0: % wolffd@0: % OUTPUT wolffd@0: % cstr cell array of strings, all leading and trailing wolffd@0: % spaces are deleted. Substring ch is removed from string. wolffd@0: % wolffd@0: % EXAMPLES wolffd@0: % a = strsplit('aaa bbb ccc ', ' ') wolffd@0: % Result: a{1}='aaa', a{2}='bbb', a{3}='ccc' wolffd@0: % a = strsplit('user@server', '@') wolffd@0: % Result: a{1}='user', a{3}='server' wolffd@0: % a = strsplit('aabbccddeeffgg', 'dd') wolffd@0: % Result: a{1}='aabbcc', a{2} = 'eeffgg' wolffd@0: % wolffd@0: % RELATED wolffd@0: % strfun, depreciated stringify.m wolffd@0: wolffd@0: % Copyright (C) 2002 Marc Molinari, University of Southampton wolffd@0: % Author: Dr Marc Molinari wolffd@0: % $Revision: 1.1 $ $Date: 2005/04/15 17:12:14 $ $Tag$ wolffd@0: