klyn.MutableString._slice
method
public static _slice(text as MutableString, start as Long, stop as Long, sliceStep as Long, hasStart as Boolean, hasStop as Boolean) as String
Description

Implements scalar-based slicing while preserving omitted bounds.

Parameters
ParameterDescription
textSource.
startStart index.
stopExclusive stop index.
sliceStepNonzero step.
hasStartWhether start was supplied.
hasStopWhether stop was supplied.
Returns

An immutable slice.

Throws
  • ValueException for a zero slice step.
Example
assert m"Klyn"[::-1] == m"nylK"