uiua-lang/uiua

Feature request: String or Char manipulation

Closed this issue · 1 comments

It would be nice to add some standardised functions, possibly system functions, to at the very least change the casing of strings or chars, like &strup and &strdn for up and down-casing.

It would also be nice to see string formatting added to the _ placeholders in $ strings, so that floating point numbers can be truncated in some way.

If these things already exist, I couldn't find them in the documentation

There are case-conversion examples in the uiuisms.
If you want to truncate a formatted number to a certain number of decimal places, you can write your own function, maybe something like

f ← ↙+1+⊙∶⊗1=@..$"_"∶
f 3 123.456789

In general, I won't add things that are easily implementable in just one line of code unless they are extremely common operations that pertain to generic array manipulation.
The system functions, prefixed with &, are functions whose implementation is platform-dependent and impossible to implement in the language itself, so things like string casing would not qualify.