Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jujuadams/string_split_moreso
Extended string_split() functions for GameMaker
https://github.com/jujuadams/string_split_moreso
gamemaker gamemaker-studio-2 gms2 string
Last synced: about 2 months ago
JSON representation
Extended string_split() functions for GameMaker
- Host: GitHub
- URL: https://github.com/jujuadams/string_split_moreso
- Owner: JujuAdams
- License: mit
- Created: 2024-08-13T13:22:24.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-13T13:47:41.000Z (5 months ago)
- Last Synced: 2024-08-13T16:26:33.078Z (5 months ago)
- Topics: gamemaker, gamemaker-studio-2, gms2, string
- Language: Yacc
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
string_split_moreso
Extended string_split() functions for GameMaker
### `string_split_escaped()`
GameMaker's native `string_split()` but with additional support for escape characters.
Examples:
```
string_split_escaped("0#1", "#") -> ["0", "1"]
string_split_escaped("0\\#1", "#") -> ["0#1"]
string_split_escaped("0\\\\#1", "#") -> ["0\", "1"]
```
### `string_split_open_close()`
GameMaker's native `string_split()` but using an open and close delimiter. This is useful for handling BBCode-style formatting tags etc. Returned array will have content found between the open and close delimiters stored in odd-numbered indexes in the array.
**N.B.** Tags cannot be nested inside other tags.
Examples:
```
string_split_open_close("0[1]2", "[", "]") -> ["0", "1", "2"]
string_split_open_close("[1]", "[", "]") -> ["", "1", ""]
string_split_open_close("0[1][3][5]6", "[", "]") -> ["0", "1", "", "3", "", "5", "6"]
```
### `string_split_open_close_escaped()`
GameMaker's native `string_split()` but using an open and close delimiter and supporting escape characters. This is useful for handling BBCode-style formatting tags etc. Returned array will have content found between the open and close delimiters stored in odd-numbered indexes in the array.
**N.B.** Tags cannot be nested inside other tags.
Examples:
```
string_split_open_close("0[1]2", "[", "]") -> ["0", "1", "2"]
string_split_open_close("[1]", "[", "]") -> ["", "1", ""]
string_split_open_close("\\[0]", "[", "]") -> ["[0]"]
string_split_open_close("0[1][3][5]6", "[", "]") -> ["0", "1", "", "3", "", "5", "6"]
```