Skip to content

[cBuffer] String Manipulation Helpers #72

@hnakamur

Description

@hnakamur

I propose lev.string module.

It should be upper-compatible to lua's string module.

These are draft APIs for additional functions.

string.startsWith(s, prefix):boolean
string.endsWith(s, prefix):boolean
string.indexOf(s, predicate_func, startIndex):number or nil
string.lastIndexOf(s, predicate_func, startIndex):number or nil

string.ltrim(s, trimChars):string
string.rtrim(s, trimChars):string
string.trim(s, trimChars):string

string.lpad(s, resultLen, padding):string
string.rpad(s, resultLen, padding):string

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions