Strings.slice()

Get a substring of consecutive characters from a string.

Usage

Hover over inputs/exits for more info.

var Strings = require('machinepack-strings');


// Get a substring of consecutive characters from a string.

Strings.slice({

string: 'McGee',

start: 2,

end: 3,

}).execSync();

Inputs

string required

The string to get a slice of.

'McGee'
start required

The index of the first item to include in the new substring.

2
end

The index of the last item to include in the new substring.

3

Exits

error

An unexpected error occurred.

success

OK.

'Ge'