Return a left-justified unicode string of length width. >>> unicode_ljust('Hello', 15, '*') 'Hello**********' >>> unicode_ljust('你好', 15, '*') '你好***********' >>> unicode_ljust('안녕하세요', 15, '*') '안녕하세요*****' >>> unicode_ljust('こんにちは', 15, '*') 'こんにちは*****'
(string: str, width: int, fillbyte: str = ' ')
| 26 | |
| 27 | |
| 28 | def unicode_ljust(string: str, width: int, fillbyte: str = ' ') -> str: |
| 29 | """Return a left-justified unicode string of length width. |
| 30 | >>> unicode_ljust('Hello', 15, '*') |
| 31 | 'Hello**********' |
| 32 | >>> unicode_ljust('你好', 15, '*') |
| 33 | '你好***********' |
| 34 | >>> unicode_ljust('안녕하세요', 15, '*') |
| 35 | '안녕하세요*****' |
| 36 | >>> unicode_ljust('こんにちは', 15, '*') |
| 37 | 'こんにちは*****' |
| 38 | """ |
| 39 | return string.ljust(width - _count_wchars(string), fillbyte) |
| 40 | |
| 41 | |
| 42 | def unicode_rjust(string: str, width: int, fillbyte: str = ' ') -> str: |
no test coverage detected