Bookshelf icon indicating copy to clipboard operation
Bookshelf copied to clipboard

`bs.string`: A module to manage strings

Open theogiraudet opened this issue 1 year ago • 1 comments

New facility functions to manipulate string:

  • [ ] To char array
  • [ ] Index of
  • [ ] Split according to a char

theogiraudet avatar May 11 '24 14:05 theogiraudet

I can take this module

aure31 avatar Oct 27 '24 11:10 aure31

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?

aure31 avatar Oct 27 '24 16:10 aure31

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)?

theogiraudet avatar Nov 26 '24 19:11 theogiraudet

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

aure31 avatar Nov 26 '24 20:11 aure31

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!

theogiraudet avatar Nov 26 '24 20:11 theogiraudet