How should I change this format string such that whitespaces between the strings and the commas become optional(/or not allowed, if that is simpler) ?Code:" [ %s , %s , %s , %s ] "
...just removing the spaces doesn't seem to work...
How should I change this format string such that whitespaces between the strings and the commas become optional(/or not allowed, if that is simpler) ?Code:" [ %s , %s , %s , %s ] "
...just removing the spaces doesn't seem to work...
Look into the %[] conversion specifier. It also depends on how your input actually is. It's sort of silly for "formatted input" to be flexible. That goes against the whole "formatted" thing. Use %s, if ',' is at the end, trim it.
Quzah.
Hope is the first step on the road to disappointment.