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 string doesn't have a character at the specified index (i.e. it's too short)

success

OK.

'ñ'