How Do I Count Digits in String Text?

Howdy, this is probably easy but I cant quite wrap my head around how to do it.
I basically need to analyze an incoming text strings length, then based on that length, add
spaces after the text to get to a desired length for a more clean serial display text box.

so, lets say I need 50 characters per line -
if my incoming string is 30, I need to then join 20 spaces after the text.
is this possible?

i'm really struggling with conceptualizing how to add a variable amount of " " (spaces) without the coding looking ridiculous.

thanks for all the help!

Something like this ? ( I used a 0 instead of a space for visibility.)



ah heck, a while loop - yep that would work much better - not really any way to populate more than one space at a time from what I can figure out.
thank you, that solves that issue!

and as a procedure


1 Like

I love this solution.

Killing flies with cannon shots ("Matar moscas a cañonazos")
(but it is useful if you have to fill in a lot of data at once ... many many) :sweat_smile:

Pruebas.aia (2.9 KB)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.