当前位置:网站首页>12 - container - string
12 - container - string
2022-04-22 05:58:00 【ʕ·͡ˑ· ཻ ʔ**ʕ·͡ˑ· ཻ ʔ】
Catalog
3、 ... and 、 Subscript ( Indexes )
5、 ... and 、 String lookup method find()
6、 ... and 、 String substitution method replace()
7、 ... and 、 String splitting method split()
8、 ... and 、 String connection method join
One 、 Definition of string
Two 、 Special string handling
-
Application scenarios : According to different needs , Sometimes you need to deal with some special string data .
3、 ... and 、 Subscript ( Indexes )
-
Definition : The index is the data in the container ( character string 、 list 、 Tuples ) Position in , Number . Generally, positive index is used , from 0 Start .
-
effect : You can get the data of a specific location in the container through the index .
-
Usage method : Containers [ Subscript ]
Four 、 section
-
effect : Using slicing operations , Multiple data in the container can be obtained at one time .
-
grammar : Containers 【start:end:step】
5、 ... and 、 character string To find the way find()
-
Usage method :
-
effect : Whether the searched character exists in the current string .
-
explain :
-
Illustrate with examples - String search
6、 ... and 、 String substitution method replace()
-
Usage method :
-
effect : Use new substring , Replace the old string contents according to the rules . The string is of immutable data type , So the modification will not affect the original content .
-
explain :
-
Illustrate with examples - String substitution
7、 ... and 、 String splitting method split()
-
Usage method :
-
effect : Separates strings by the specified character .
-
explain :
8、 ... and 、 String connection method join
-
Usage method :
-
effect : It is generally used to merge the list into a string according to the specified sub characters .
-
explain :
-
Illustrate with examples - String connection
版权声明
本文为[ʕ·͡ˑ· ཻ ʔ**ʕ·͡ˑ· ཻ ʔ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220538276945.html
边栏推荐
- 苹果 cms 自定义对接微信公众号
- 机器学习入门——Numpy中的arg运算
- 0/1背包问题(动态规划+动规优化)
- TCGA database Ensembl ID is transformed into gene symbol to extract the required RNA species expression profile list information
- Converts a nonnegative decimal integer n to a binary
- Judge whether the linked list has a ring (Set & speed pointer)
- The postgraduate entrance examination is over
- Torch uses stepping on the pit diary and matrix to speed up the operation
- uniapp:HBuilderX运行uniapp项目到夜神模拟器
- layer关闭弹窗,刷新父页面
猜你喜欢

Blue Bridge Cup 31 day sprint Day7

2021 408 changes in postgraduate entrance examination outline

Leetcode interview question 17.09 Number k -- dynamic programming

LeetCode 589. Preorder traversal of n-ary tree

蓝桥杯31天冲刺 Day8

miniconda 换源(添加镜像)

13 - 容器-列表

14 - 容器-元组

LeetCode 2044. Count the number of subsets that can get the maximum value by bit -- depth traversal

蓝桥冲刺专题——BFS
随机推荐
09 - 流程控制 - 判断语句
Reading package list Finished analyzing dependency tree of package. Reading status information Some packages cannot be installed after completion. If you are using an unstable distribution, this may b
Leetcode 486 Predicting Winners -- dynamic programming + game theory
Summary of MySQL knowledge points
记录一次安装centos8+postgresql9.6+postgis的惨痛经历
Pytorch environment preparation
Dictionary tree template
Code analysis of STL alloc space allocator
LeetCode 1591. Strange printer II -- judgment sorting
conda命令
Several ways to exchange two variable values without the third variable
最大连续子序列和(枚举+分治+在线处理)
typescript:基础知识
layer关闭弹窗,刷新父页面
判断链表是否有环(集合&快慢指针)
Blue Bridge Cup 31 day sprint Day17
蓝桥杯31天冲刺 Day16
C语言--经典100题
ubuntu20.0.4下在终端安装数据库
Skewness and kurtosis