berry icon indicating copy to clipboard operation
berry copied to clipboard

Add string.startswith and string.endswith

Open s-hadinger opened this issue 1 year ago • 0 comments

See @405. Add:

  • string.startswith(hay:string, needle:string [, case_insensitive:bool]) -> bool
  • string.endswith(hay:string, needle:string [, case_insensitive:bool]) -> bool

These new methods are lightweight, allow for case sensitive or case insensitive matches, and don't need to allocate any temporary object.

s-hadinger avatar Mar 10 '24 12:03 s-hadinger