strtruncl#

Purpose#

Truncates the left side of all elements of a string array by a user-specified number of characters.

Format#

y = strtruncl(sa, ntrunc)#
Parameters:
  • sa (NxM or Nx1, 1xM, or 1x1 string array.) – data

  • ntrunc (NxM or Nx1, 1xM, or 1x1 matrix) – the number of characters to strip.

Returns:

y (string array) – contains contents of sa with left side of all elements truncated to length specified by ntrunc.

Examples#

sa = "Hello World" $| "GAUSS";

// Remove 3 characters from the left
y = strtruncl(sa, 3);
print y;

The code above produces the following output:

lo World
SS

Source#

strfns.src