当前位置:网站首页>Definition and method of string
Definition and method of string
2022-07-04 11:07:00 【It's a cinch!】
Define methods :
s=str()
s=''
s=""
s=""""""
capitalize—— Returns the uppercase of the first character of a string Variable .capitalize()
title—— Converts a string to a title and returns Variable .title()
rlowe—— Converts a string to a lowercase string and returns Variable .capitalize()
upper—— Converts a string to an uppercase string and returns Variable .capitalize()
istitle—— Determine whether the string is a title Variable .capitalize()
islower—— Determine whether the string is all lowercase Variable .capitalize()
isupper—— Determine whether the string is all uppercase Variable .capitalize()
isalpha—— Determine whether the string is all alphabetic Variable .isalpha()
isdigit—— Determine whether the string is all numbers Variable .isdigit()
isspace—— Judge whether the string is all spaces Variable .isspace()
isanlum—— Determine whether the string is a valid character Variable .isanlum()
center—— According to the length of the string ( Must be greater than the length of the string itself , The unit is the sign bit ) To center ,fillchar( Optional parameters ) Default is space Variable .center(width[,fallchar('')],/)
count—— Count the number of characters Variable .count('*' | "**")
endswith—— Determine whether the string is based on '*** For the end Variable .endswith('**')
startswith—— Determine whether the string is based on '***' Start Variable .startswith('**')
find—— Find the first occurrence of a character or string , If there is no return -1 Variable .find('**')
rfind—— Find the position of the first occurrence of a character or string from right to left , If there is no return -1 Variable .rfind('**')
index—— Find the first position of the character or string from left to right , If it doesn't exist, an error will be reported Variable .index('**')
rindex—— Find the first position of the character or string from right to left , If it doesn't exist, an error will be reported Variable .rindex('**')
encode—— Convert string to byte (byte) Methods (python3) Variable .encode('**')
①:1 byte (byte) = 8 position (bit)
②: stay 16 Bit system ( such as 8086 microcomputer ) 1 word (word)= 2 byte (byte)= 16(bit)
stay 32 Bit system ( such as win32) 1 word (word)= 4 byte (byte)=32(bit)
stay 64 Bit system ( such as win64)1 word (word)= 8 byte (byte)=64(bit)
*decode—— Byte (byte) Methods to convert to strings
边栏推荐
- Locust learning record I
- regular expression
- [Galaxy Kirin V10] [desktop] login system flash back
- Local MySQL forgot the password modification method (Windows)
- How to use diff and patch to update the source code
- Get the data of the top 100 headlines today with Tianxing data
- Customized version of cacti host template
- JMeter assembly point technology and logic controller
- Capl: timer event
- 三立期货安全么?期货开户怎么开?目前期货手续费怎么降低?
猜你喜欢
Canoe - the third simulation project - bus simulation - 3-2 project implementation
[Galaxy Kirin V10] [server] NUMA Technology
JMeter Foundation
2022 AAAI fellow release! Yan Shuicheng, chief scientist of sail, and Feng Yan, Professor of Hong Kong University of science and technology, were selected
[machine] [server] Taishan 200
[Galaxy Kirin V10] [desktop] cannot add printer
[Galaxy Kirin V10] [server] KVM create Bridge
Introduction to canoe automatic test system
Take advantage of the world's sleeping gap to improve and surpass yourself -- get up early
Replace() function
随机推荐
Network connection (III) functions and similarities and differences of hubs, switches and routers, routing tables and tables in switches, why do you need address translation and packet filtering?
array_ The contains() function uses
Fundamentals of software testing
If function in SQL
Elevator dispatching (pairing project) ③
[Galaxy Kirin V10] [server] soft RAID configuration
VPS installation virtualmin panel
Replace() function
Simple understanding of seesion, cookies, tokens
[Galaxy Kirin V10] [desktop] printer
Jemeter plug-in technology
Installation of ES plug-in in Google browser
2022 ape circle recruitment project (software development)
SQL greatest() function instance detailed example
Function introduction of canbedded component
Unittest+airtest+beatiulreport combine the three to make a beautiful test report
Analysis function in SQL
[Galaxy Kirin V10] [server] KVM create Bridge
Basic function exercises
Introduction to canoe automatic test system