Strings.slice()

Get a substring of consecutive characters from the string.

Usage

Hover over inputs/exits for more info.

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


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

Strings.slice({

string: 'McGee',

start: 2,

end: 5,

}).execSync();

Inputs

string required

The string to slice.

'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.

5

Exits

error

An unexpected error occurred.

success

OK.

'Gee'