I would like to left-pad spaces in a string as needed so it is always 8 characters long. I would also like to limit the initial string to 8 characters. Example:
Given string of "1234"
, should become "\s\s\s\s1234"
Given string of "123456789"
, should become "12345678"
I've tried "Scan From String" function using a format specifier of %8.8s
, which I thought should limit the original length to 8 or less characters, and then pad spaces as necessary, to ensure a maximum of 8 characters in total.
I was expecting "1234"
text to be turned into " 1234"
but it just returned "1234"
.
It's labview "G" code so I can't enter text code.