![]() |
Type in a command, or "ls dictionary" to search all commands for "dictionary", etc.
|
NAME
substring - Extract a substring of a given string
SYNOPSIS
substring [STRING TO PARSE] -start [START POSITION] -end [STOP POSITION]
EXAMPLES
% substring Hello World -start 2 -end 8
==> ello Wo
% substring Hello World -start 4
==> lo World
% substring Hello World -end 8
==> Hello Wo
% substring Hello World
==> Hello World
DESCRIPTION
Extracts a substring from a provided string. -start and -end
are both optional. Positions are *inclusive* and begin at 1.
The following illustrates the command's course of action:
-start and -end provided
: return substring from position START to position END
-start provided, -end not provided
: return strLeft beginning at position START
-start not provided, -end provided
: return strRight terminating at position END
-start not provided, -end not provided
: return the string
Positions are *inclusive* and begin at 1.
AUTHOR
Gershman, David A (gershman@dagertech.net)
Thanks to:
Jonathan Aquino for YubNub!
Allen Ormond for 'ifthen', 'sum', 'strLength',
'strLeft', and 'strRight'!