function [C,R]=strExtract(str,loc,trim)
% strExtract <Extract strings between given locations.>
%Usage:: [C,R*]=StrExtract(str,loc,trim[0])
%

% revision history:
% 04/24/16 Mark D. Shattuck <mds> strExtract.m

%% Parse Input
if(~exist('trim','var') || isempty(trim))
	trim=0;
end

%% Parse Ouput
if(nargout>1)
  Rout=true;
else
  Rout=false;
end

%% Main
idx=num2cell(loc,1);

C=cellfun(@(x) str(x(1):x(2)),idx,'uniformoutput',false);

if(Rout)
  R=0;
end

