This is a static copy of a profile report

Home

strip (Calls: 2, Time: 0.002 s)
Generated 04-Jun-2021 04:11:08 using performance time.
function in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\strfun\strip.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...tectImportOptions.set.EmptyColumnTypeclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
61
s = convertStringToOriginalTex...
20.001 s36.8%
47
if ~isTextStrict(str)
20.001 s30.9%
56
s = s.strip();
20.000 s9.9%
55
if nargin == 1
20.000 s3.5%
53
s = string(str);
20.000 s3.4%
All other lines  0.000 s15.4%
Totals  0.002 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
strfun\private\isTextStrictfunction20.000 s20.0%
str...te\convertStringToOriginalTextTypefunction20.000 s19.3%
Self time (built-ins, overhead, etc.)  0.001 s60.7%
Totals  0.002 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function66
Non-code lines (comments, blank lines)49
Code lines (lines that can run)17
Code lines that did run11
Code lines that did not run6
Coverage (did run/can run)64.71 %
Function listing
time 
Calls 
 line
   1 
function s = strip(str, varargin)
   2 
%STRIP Remove leading and trailing whitespaces
   3 
%   NEWSTR = STRIP(STR) removes all consecutive whitespace characters from
   4 
%   the beginning and the end of STR. Whitespace is defined as any sequence
   5 
%   of whitespace characters such as spaces, tabs, and newlines.
   6 
%
   7 
%   STR can be a string array, character vector, or cell array of character
   8 
%   vectors. If STR is a string array or cell array, then STRIP removes
   9 
%   leading and trailing whitespace from each element of STR.
  10 
%
  11 
%   NEWSTR = STRIP(STR,SIDE) removes whitespace characters from the
  12 
%   specified SIDE. SIDE can be 'left', 'right', or 'both'.  The default
  13 
%   value of SIDE is 'both'.
  14 
%
  15 
%   NEWSTR = STRIP(STR,PAD_CHARACTER) removes PAD_CHARACTER from STR.
  16 
%   PAD_CHARACTER must be exactly one character.
  17 
% 
  18 
%   NEWSTR = STRIP(STR,SIDE,PAD_CHARACTER) removes PAD_CHARACTER from the
  19 
%   specified SIDE.
  20 
% 
  21 
%   Example:
  22 
%
  23 
%       STR = ["moustache "; 
  24 
%              "   goatee";
  25 
%              "   beard    "];
  26 
%       strip(STR)
  27 
%
  28 
%       returns
  29 
%
  30 
%           "moustache"
  31 
%           "goatee"
  32 
%           "beard"
  33 
%
  34 
%   Example:
  35 
%       strip("C:\Temp\Files\",'right','\')
  36 
%
  37 
%       returns
  38 
%
  39 
%           "C:\Temp\Files"
  40 
%       
  41 
%   See also PAD, STRING, REPLACE
  42 

  43 
%   Copyright 2016 The MathWorks, Inc.
  44 

< 0.001 
      2 
  45
    narginchk(1, 3); 
  46 
    
< 0.001 
      2 
  47
    if ~isTextStrict(str) 
  48 
        firstInput = getString(message('MATLAB:string:FirstInput'));
  49 
        error(message('MATLAB:string:MustBeCharCellArrayOrString', firstInput));
< 0.001 
      2 
  50
    end 
  51 

< 0.001 
      2 
  52
    try 
< 0.001 
      2 
  53
        s = string(str); 
  54 
        
< 0.001 
      2 
  55
        if nargin == 1 
< 0.001 
      2 
  56
            s = s.strip(); 
  57 
        else
  58 
            s = s.strip(varargin{:});
< 0.001 
      2 
  59
        end 
  60 
        
< 0.001 
      2 
  61
        s = convertStringToOriginalTextType(s, str); 
  62 
        
  63 
    catch E
  64 
        throw(E)
< 0.001 
      2 
  65
    end 
< 0.001 
      2 
  66
end 

Other subfunctions in this file are not included in this listing.