bjcscat / string_macros

Small proc macro library for handling string literals
Apache License 2.0
0 stars 0 forks source link

Add more macros? #1

Open xuxiaocheng0201 opened 1 month ago

xuxiaocheng0201 commented 1 month ago

Only contains ascii_lowercase and ascii_uppercase is too simple. Add more macros like repeat, trim, etc.?

bjcscat commented 1 month ago

Yeah, I'll look into adding some more string transformations. Were there any that you were interested in seeing beyond repeat and trim?

xuxiaocheng0201 commented 1 month ago

My idea is an 'ultimate' macro. It compiles and runs the code written in the macro at compile time. For example:

static_str!("A".repeat(8) + "bbbccc" + include_str!("something.txt"))

After expending, it becomes "AAAAAAAAbbbcccSomething in the text".