Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC]: Add @stdlib/string/first #853

Closed
3 tasks done
kgryte opened this issue Feb 7, 2023 · 0 comments · Fixed by #989
Closed
3 tasks done

[RFC]: Add @stdlib/string/first #853

kgryte opened this issue Feb 7, 2023 · 0 comments · Fixed by #989
Labels
Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! RFC Request for comments. Feature requests and proposed changes.

Comments

@kgryte
Copy link
Member

kgryte commented Feb 7, 2023

Description

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

Signature:

first( str[, n] )

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

E.g.,

first( 'foo bar' );
// returns 'f'

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

Package: @stdlib/string/first
Alias: first

Related Issues

None.

Questions

No.

Other

See @stdlib/string/remove-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:.
@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! labels Feb 7, 2023
Planeshifter added a commit that referenced this issue Jun 2, 2023
PR-URL: #989
Closes: #853
Co-authored-by: Athan Reines <kgryte@gmail.com>
Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Athan Reines <kgryte@gmail.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue or pull request for adding a new feature. Good First Issue A good first issue for new contributors! RFC Request for comments. Feature requests and proposed changes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant