Re: [elixir-core:11190] Re: Proposal: Introduce string limit function.

2022-11-19 Thread Zach Daniel
It would be great to come up with some kind of heuristic and/or consistent philosophy on what belongs in the standard library, to guide these discussions. Some kind of rubric could make these kinds of conversations easier or even prevent them entirely. For me, the main guiding principles are whe

[elixir-core:11190] Re: Proposal: Introduce string limit function.

2022-11-19 Thread Ben Wilson
This seems reasonably straight forward to implement in your own code base: ``` def truncate(string, length, padding \\ ".") do string |> String.slice(0, length) |> String.pad_trailing(String.length(string), padding) end ``` Not seeing a strong need to include it in the standard library. Jus