-
Notifications
You must be signed in to change notification settings - Fork 1
melon.string
garryspins edited this page Feb 27, 2026
·
5 revisions
melon.string

String manipulation library, think a templating engine
Syntax is simple
melon
melon.string.Format("{1} {2} {3}", "first", "second", "third")
melon.string.Format("{1.1}", {"value in a table"})
melon.string.Format("{1.key}", {key = "by a key"})
melon.string.Format("{1.key | uppercase}", {key = "by a key"})
melon.string.Format("{uppercase($1)}", "make this uppercase")
melon.string.Format("the following is escaped: {!uppercase($1)}")

melon.string.Format(fmt: string, args: any...) -> string
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | fmt | string | String format to use, see [melon.string] for a reference |
| 2 | args | any... | Any values to be passed to the formatter |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | str | string | Formatted string |
Formats a string using the melonlib formatter
