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

StdLibs String methods #3

Open
jaredlll08 opened this issue Jan 19, 2022 · 1 comment
Open

StdLibs String methods #3

jaredlll08 opened this issue Jan 19, 2022 · 1 comment
Assignees
Milestone

Comments

@jaredlll08
Copy link
Member

No description provided.

@stanhebben
Copy link
Contributor

stanhebben commented Jan 19, 2022

Methods that should be supported built-in, or which are already supported:

  • charAt: should already be possible with indexing
  • chars: add to language as .chars property (if not already)
  • compareTo: should be available (I'll need to check how)
  • concat: use + operator
  • contains: in operator
  • equals: == operator
  • length
  • substring: use range indexing for this
  • valueOf: already supported with casts

Methods which should be in stdlib:

  • compareToIgnoreCase
  • endsWith
  • equalsIgnoreCase
  • getBytes (we already have a function in stdlib for this, an ascii and utf-8 variant)
  • indexOf (all 4 overloads)
  • isBlank: add to stdlib as getter (.blank)
  • isEmpty: add to stdlib as getter (.empty)
  • join: add to stdlib as expansion on string[]
  • lastIndexOf (all 4 overloads)
  • repeat
  • replace
  • replaceFirst
  • split (both with and without limit) (having a variant with just literal strings in stdlib would be nice. but no regexes yet. maybe a regex-supporting variant can be added as Java specific)
  • startsWith
  • strip
  • stripLeading
  • stripTrailing
  • toLowerCase
  • toUpperCase

Methods that should not be in the language or in stdlib, but can still be added to Java integration:

Methods that are redundant:

  • copyValueOf
  • subSequence: use substring instead
  • toCharArray
  • trim (use strip)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants