webCOMAND

#STRING_BYTES

Return a string of bytes from a portion of a source string, without regard for multi-byte characters in a UTF8 string.  This operates on a string as a byte stream, not a character stream.

Prototype

#STRING_BYTES($string, $start = 0, $length = NULL)

Parameters

  • string - The input string.
  • start - Zero-based byte offset into string where returned substring should start.
  • length - Length in bytes from the start where returned substring should end.  NULL will return all the way to the end of the input string.

Return

Returns a new string of bytes from the input string based on the specified start and length.

Example

#/ Display "is some"
#LOCAL($Text, "This is some text.")
#STRING_BYTES($Text, 5, 7)