Strings.at()

Get a character from a string at a particular position.

Usage

Hover over inputs/exits for more info.

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


// Get a character from a string at a particular position.

Strings.at({

string: 'villeriño',

at: 7,

}).execSync();

Inputs

string required

The source string.

'villeriño'
at required

The index to look up within the string.

7

Exits

error

An unexpected error occurred.

notFound

The specified string didn't have a character at the specified index (i.e. it was too short).

success

OK.

'ñ'