Forums > MaxMSP

Removing space in message while keeping leading 0

Apr 15 2014 | 6:06 pm

I’m trying to remove the space that is front of a number while still keeping the 0 that is prefixed when the number is 9 or less. I’ve tried sprintf, combine, and regex but they strip the 0 from the beginning of the digit.
Any ideas?

-- Pasted Max Patch, click to expand. --

Apr 17 2014 | 12:46 pm

What space are you talking about?

Apr 17 2014 | 12:51 pm

In the patch I pasted, if you click the output message, there is a space right before the digits, just one. I need the 0 in front of the digit (I know Max doesn’t like 0’s leading integers so I’m using the sprintf to get around that), but it’s leaving a space in the first index.

Apr 17 2014 | 4:14 pm

That space is in your sprintf object. This should work:

-- Pasted Max Patch, click to expand. --

Viewing 4 posts - 1 through 4 (of 4 total)

Forums > MaxMSP