MCPcopy Create free account
hub / github.com/archlinux/archinstall / unicode_rjust

Function unicode_rjust

archinstall/lib/utils/encoding.py:42–53  ·  view source on GitHub ↗

Return a right-justified unicode string of length width. >>> unicode_rjust('Hello', 15, '*') '**********Hello' >>> unicode_rjust('你好', 15, '*') '***********你好' >>> unicode_rjust('안녕하세요', 15, '*') '*****안녕하세요' >>> unicode_rjust('こんにちは', 15, '*') '*****こんにちは'

(string: str, width: int, fillbyte: str = ' ')

Source from the content-addressed store, hash-verified

40
41
42def unicode_rjust(string: str, width: int, fillbyte: str = ' ') -> str:
43 """Return a right-justified unicode string of length width.
44 >>> unicode_rjust('Hello', 15, '*')
45 '**********Hello'
46 >>> unicode_rjust('你好', 15, '*')
47 '***********你好'
48 >>> unicode_rjust('안녕하세요', 15, '*')
49 '*****안녕하세요'
50 >>> unicode_rjust('こんにちは', 15, '*')
51 '*****こんにちは'
52 """
53 return string.rjust(width - _count_wchars(string), fillbyte)

Callers 1

as_tableFunction · 0.90

Calls 1

_count_wcharsFunction · 0.85

Tested by

no test coverage detected