The escape character placeholder

Backslash character in the string table

Escaped format significance
\' apostrophe(')
\" Double quotes(")
\\ The backslash (\)
\n Wrap
\r Return the cursor to the beginning of the line
\f Feed
\t Horizontal tab
\ v Tabs Shigenao
\b fall back
\0 Null character, character zero
\0oo oo for the two octal character representation
\xXX XX is the two-digit hexadecimal representation of the character
\uXXXX Character hexadecimal representation of the Unicode 16
\UXXXXXXXX Unicode character hexadecimal representation of 32

 

 

Format string type code and placeholders

 

Placeholder type code significance
%s String
%r String, instead of using repr str
%c Integer to a single character
%d Decimal integer
%O Octal integer
%x Hexadecimal integer (lowercase characters af)
%X Hexadecimal integer (uppercase characters AF)
%e Floating-point exponential (e lowercase), as 2.9e + 10
%E Floating-point exponential (E uppercase), as 2.9E + 10
%f, %F Floating point decimal form
% G,% G Decimal floating-point or floating-point automatic conversion index
%% Equivalent to one percent character

Guess you like

Origin www.cnblogs.com/water-1/p/10931090.html