Text.drop
droprange
Group: Selections
Aliases: remove
, skip
Documentation
Creates a new Text by removing the specified range of the input. This can select a section of text from the beginning, end, or middle of the input using various criteria defined by the range parameter.
Arguments
range
: The section of the this text to return. If aText_Sub_Range
, then the selection is interpreted following the rules of that type. If aRange
, the selection is specified by two indices, from and to.
Returns
The part of the input as specified by the range parameter.
Examples
Various different ways to take part of "Hello World!"
"Hello World!".drop ..First == "ello World!"
"Hello World!".drop (..First 5) == " World!"
"Hello World!".drop (..First 0) == "Hello World!"
"Hello World!".drop ..Last == "Hello World"
"Hello World!".drop (..Last 6) == "Hello "
"Hello World!".drop (..Before " ") == " World!"
"Hello World!".drop (..Before_Last "o") == "orld!"
"Hello World!".drop (..After " ") == "Hello "
"Hello World!".drop (..After_Last "o") == "Hello Wo"
"Hello World!".drop (..While c->c!=" ") == " World!"
"Hello World!".drop (..Range 3 5) == "Hel World!"
"Hello World!".drop (..Range 5 Nothing) == "Hello"
"Hello World!".drop (..Range 5 12) == "Hello"
"Hello World!".drop (..Range 6 12 2) == "Hello ol!"
"Hello World!".drop (..Every 2 first=6) == "Hello ol!"
"Hello World!".drop (..Every 3) == "elo ord!"
"Hello World!".drop (..By_Index 0) == "ello World!"
"Hello World!".drop (..By_Index [1, 0, 0, 6, 0]) == "llo orld!"
"Hello World!".drop (..By_Index [Range 0 3, 6, Range 6 12 2]) == "lo ol!"
"Hello World!".drop (..Sample 3 seed=42) == "HeloWorl!"