mttDetachText.m 498 B

123456789101112131415
  1. function [detached_text,preceding_text] = mttDetachText(text,delimiter)
  2. if isempty(text)
  3. detached_text = [] ;
  4. preceding_text = [] ;
  5. else
  6. where = max(findstr(text,delimiter)) ;
  7. if isempty(where)
  8. detached_text = [] ;
  9. preceding_text = mttClipText(text) ;
  10. else
  11. detached_text = mttClipText(text(where+length(delimiter):length(text))) ;
  12. preceding_text = mttClipText(text(1:where-1)) ;
  13. end
  14. end