Skip to content

[RFC]: Add @stdlib/string/last #854

Closed
@kgryte

Description

@kgryte

Description

This RFC proposes adding support for returning the last (visual) character(s) of a string.

Signature:

last( str[, n][options] )

where n specifies the number of visual characters to return. Default: 1.

E.g.,

last( 'foo bar' );
// returns 'r'

last( '🐶🐮🐷🐰🐸', 2 );
// returns '🐰🐸'

Package: @stdlib/string/last
Alias: last

Related Issues

None.

Questions

No.

Other

See @stdlib/string/first for a similar package.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.

Metadata

Metadata

Assignees

Labels

AcceptedRFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.JavaScriptIssue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.UtilitiesIssue or pull request concerning general utilities.difficulty: 3Likely to be challenging but manageable.priority: NormalNormal priority concern or feature request.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions