Tab character in strings

I’m trying to format a table-of-contents type list with a tab character between the page number and layout name, however Rhino doesn’t seem to recognise the tab character (works fine with \n and other escaped characters).

Wonder if it’s similar to this issue > Tab character does not work in ghpython.

Tabs in the Rhino text panel seem to convert to spaces anyway - are tabs not supported in Rhino? If not, are there any clever ways to get tab-like behavior? Currently I’m using pythons zfill() on the page numbers so that when using spaces between the page numbers and layout names they aligned i.e.

01 Layout
10 Layout

But it feels a little hacky…

Any thoughts?

Have you tried parsing with regex?


You can also use a format specifier to get the same effect as zfill.