#String help (again)

1 messages · Page 1 of 1 (latest)

tender siren
#

++ is compile-time construct. If you're looking for something runtime, you'll need to deal with buffers, copying, and probably allocation. Zig doesn't hide these things from you like other languages do.

#

But you could simply define the different strings literals rather than building dynamically. -- alpha, alphanumber, alphasymbol, alphasymbolnumber, then dynamically chose which to return. Possibly use an enum rather than 2 bools, then switch on the enum.

#

Also a fine thing to do. Lots of existing threads here about managing memory and manipulating sequences of bytes, which is most of what string processing is about.

dull cosmos