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

melon.str.Chars(string) -> char, number
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | string | string | Input string to iterate over |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | char | char | The current character |
| 2 | number | number | The current index |
Iterates over a strings contents

melon.str.CompareSub(input: string, cmp: string, index: number) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | input | string | The string to compare with |
| 2 | cmp | string | The string to check for |
| 3 | index | number | The starting index |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Was the string found at this index |
Checks if a string is within the given input string at the given index, including that index

melon.str.Split(string, delimiter: string, times?: number) -> table

melon.str.SplitN(string, number) -> table
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | string | string | String to split |
| 2 | number | number | How many chars per sub-string |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | split | table | Output strings |
Splits the input string so N chars are in every sub-string

melon.str.SplitOnce(string, delim: string) -> string, string
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | string | string | String to split |
| 2 | delim | string | Delimiter to split by |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | lhs | string | The left side of the split |
| 2 | rhs | string | The right side of the split |
Splits a string once given the arbitrary sized delimiter