You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: spm_str_manip.m
    path of file: ./repos/spm12
    
    the code of the file until where you have to start completion: function [strout,R2] = spm_str_manip(strin,options)
% miscellaneous string manipulation options
% FORMAT string_out = spm_str_manip(string_in,options)
% string_in    - input string, string matrix, or cell array of strings
% options      - a string of options flags, see below
%
% string_out   - output string, string matrix, or cell array of strings
% R2           - extra output for 'c' and 'C' options
%__________________________________________________________________________
% Each of the options is performed from left to right.
% The options are:
%   'r'          
    
function is now deprecated, use spm_file when possible instead.
%__________________________________________________________________________
% Copyright (C) 1996-2011 Wellcome Trust Centre for Neuroimaging

% John Ashburner
% $Id: spm_str_manip.m 4444 2011-08-26 16:47:14Z guillaume $


% persistent runonce
% if isempty(runonce)
%     warning('spm_str_manip is deprecated. Use spm_file instead.');
%     runonce = 1;
% end

if nargin<2, options=''; end
if nargin<1, strout=[]; R2=''; return, end

sep      = filesep;

strout   = cellstr(strin);
bSStrOut = ischar(strin);
R2       = '';

while ~isempty(options)
    o = 2;

    %-Read in optional numeric argument c
    %======================================================================
    opt = options(2:length(options));
    c = 0;
    if ~isempty(opt), b = opt(1); else b = '-'; end