Micropython String
Posted: Thu Feb 17, 2022 6:47 am
I was looking at print formatting with MicroPython and RP2.
Specifically I was trying to use:
I was unable to do thing because the REPL reports that there is no method ljust for str.
And, sure enough, in MicroPython 1.18 ljust (and rjust) do not exist as methods to str.
Why is there no ljust or rjust, when it is shown as examples to use for formatting?
Specifically I was trying to use:
Code: Select all
print("foo".ljust(50))
And, sure enough, in MicroPython 1.18 ljust (and rjust) do not exist as methods to str.
Code: Select all
help ("foo")
object foo is of type str
encode -- <function>
find -- <function>
rfind -- <function>
index -- <function>
rindex -- <function>
join -- <function>
split -- <function>
splitlines -- <function>
rsplit -- <function>
startswith -- <function>
endswith -- <function>
strip -- <function>
lstrip -- <function>
rstrip -- <function>
format -- <function>
replace -- <function>
count -- <function>
partition -- <function>
rpartition -- <function>
center -- <function>
lower -- <function>
upper -- <function>
isspace -- <function>
isalpha -- <function>
isdigit -- <function>
isupper -- <function>
islower -- <function>