Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
format函数主要用于格式化字符串,可以通过指定的对齐字符、前缀以及步进参数来调整字符串的显示样式。
format
func (data string) format(align int, align_data string, prefix string, step int) string
align_data
align - 1
prefix
'01234'
'01234'.format(2, '0', '\\x', 1)
\x00\x01\x02\x03\x04
'abcde'
'abcde'.format(2, ' ', '-', 2)
- a b- c d- e
'hello'
'hello'.format(1, '_', '>', 2)
>he>ll>o
'data'
'data'.format(3, '.', '#', 2)
#d.a#t.a
Was this page helpful?