I cannot figure out how to get right-padding for a string to reach a certain length. For example the string "boa", what do I tell [sprintf] to make it "boa......" –> 9 characters long with trailing spaces?
'sprintf symout %-9s' does not handle strings with spaces. When I send two words it outputs just one. I don't understand the C++ reference. At least I see no indication that spaces are handled different than other characters.
Like most max objects [sprintf] will interpret a list as being sent one item to each inlet. Seeing as you only have one % argument in the [sprintf] object it will have one inlet and only use the first item in the list. The solution is to specify the input as being one symbol, either use quotes in the message box: "my pet". Or use [tosymbol] between the list and [sprintf].
like luke said, the problem here isn't sprintf but max. when you think you're sending a string with a space, you're probably sending a list of two strings. if you need to handle strings with whitespace, you'll need to use tosymbol in some places and quotation marks in others.
actually, this is pretty much exactly what luke said. why did i even write this?