function envvar = getParallelServerEnv(var)
% Helps with rename of environment variables from format MDCE_ to
% PARALLEL_SERVER_ in R2019b
% Will get the environment variable var if it is defined -- if not, will
% try replacing 'PARALLEL_SERVER_' with 'MDCE_' and getting that.

% Copyright 2019 The MathWorks, Inc.

% Try the new name
envvar = getenv(var);
% If still empty, try using the old name
if isempty(envvar)
    envvar = getenv(strrep(var,'PARALLEL_SERVER_','MDCE_'));
end

end