mcbookshelf / Bookshelf

📚 Bookshelf is a modular library datapack designed to simplify complex systems in Minecraft maps. Ideal for mapmakers looking for easy-to-implement tools.
http://bookshelf.docs.gunivers.net
Mozilla Public License 2.0
45 stars 14 forks source link

`bs.string`: A module to manage strings #191

Open theogiraudet opened 6 months ago

theogiraudet commented 6 months ago

New facility functions to manipulate string:

aure31 commented 1 month ago

I can take this module

aure31 commented 1 month ago

the different functions offered by the string module

bs.string:index_of

[inputs] str: [str] the string (bs:in string.index_of.str) letter: [char] the letter to find index : [int]the nth occurance index

[output] $string.index_of bs.out

[use]: retrieves the index of the first recurrence of the character

bs.string:concat

[inputs] str1 : [str] (bs:in string.concat.str) str2 : [str]

[output] bs:out string.concat

bs.string:length

[inputs] str : [str] (bs:in string.length.str) [output] $string.length bs.out

bs.string:substr

[inputs] str : [str] (bs:in string.substr.str) start : [int] end : [int]

[output] bs:out string.substr

bs.string:lower

[inputs] str : [str] (bs:in string.lower.str)

[output] bs:out string.lower

bs.string:upper

[inputs] str : [str] (bs:in string.upper.str)

[output] bs:out string.upper

bs.string:char_at

[inputs] str : [str] (bs:in string.char_at.str) index : [int]

[output] bs:out string.char_at

bs.string:to_list

[inputs] str : [str] (bs:in string.to_list.str)

[output] bs:out string.to_list [list]

bs.string:split

[inputs] str : [str] (bs:in string.split.str) caracter : [char]

[output] bs:out string.split [list]

bs.string:replace

[inputs] str : [str] (bs:in string.replace.str) char : [char] new_char : [char]

[output] bs:out string.replace [str]

bs.string:replace_at

[inputs] str : [str] (bs:in string.replace_at.str) index : [int] new_char : [char]

[output] bs:out string.replace_at [str]

bs.string:join

[inputs] strings : [list[str]] (bs:in string.upper.strings) separator : [str]

[outputs] bs:out string.join [str]

here's a non-exhaustive list of the different functions what do you think?

theogiraudet commented 1 week ago

Hey @aure31 have you found time to start the module? If you're still up for it, do you think we'll be able to release it in the next iteration (no date set yet)?

aure31 commented 1 week ago

I start a little bit but the module it self is not too hard to make so I think i can finish it for the next iteration

theogiraudet commented 1 week ago

I start a little bit but the module it self is not too hard to make so I think i can finish it for the next iteration

Perfect, I link this issue to the next milestone so. Thanks!