当前位置: 首页 > news >正文

这几年做网站怎么样个人可以做推广的平台有哪些

这几年做网站怎么样,个人可以做推广的平台有哪些,wordpress导航转跳,网站开发过程阶段本章详细介绍了常用的29种字符串操作方法及代码示例。 1. 重复输出字符串 print(x * 20) 输出:xxxxxxxxxxxxxxxxxxxx 2. 通过索引获取字符串 print(hello world[2:5]) 输出:llo 3. in 判断字符是否在字符串内 print(e in hello world) 输出&…

  本章详细介绍了常用的29种字符串操作方法及代码示例。

1. 重复输出字符串

print('x' * 20)

输出:xxxxxxxxxxxxxxxxxxxx

2. 通过索引获取字符串

print('hello world'[2:5])

输出:llo

3. in 判断字符是否在字符串内

print('e' in 'hello world')

输出:True

4. % 格式化输出

print('%s world'%'hello')

输出:hello world

5. + 字符串拼接

a = 'hello '
b = ' world'
c = a + b
print(c)

输出:hello world

6. join 拼接字符串

a = 'hello'
b = ' world'
c = ' '.join([a,b])
print(c)

输出:hello world

7. count 统计字符串中指定字母的出现次数

a = 'www.baidu.com'
print(a.count('w'))

输出:3

8.center 居中

a = "www.baidu.com"
b = a.center(50, '*')
print(b)

输出:******************www.baidu.com*******************

9. startswith 判断字符串是否以指定字符串开头

a = 'www.baidu.com'
print(a.startswith('www'))

输出:True

10.find 找制定字符出现的第一个位置

a = 'www.baidu.com'
b = a.find('u')
print(b)

输出:8

11. format 格式化字符串 

a = '{0}.baidu.{1}'.format('www', 'com')
print(a) #输出www.baidu.comstring = 'hello world {xxx} {ppp}'
b = string.format(xxx='xxx', ppp = 'ppp')
print(b) #输出hello world xxx pppc = string.format_map({'xxx':'xxx', 'ppp':'ppp'})
print(c) #输出:hello world xxx ppp

12. lower 将字符串所有字符小写输出

a = 'Wang Da Bai'
print(a.lower())

输出:wang da bai

13. upper 将字符串所有字符大写输出

a = 'Wang Da Bai'
print(a.upper())

输出:WANG Da BAI

14. strip 去除掉字符串后的空格

a = 'wang da bai '
print(a.strip())  #去除尾部空格

输出:wang da bai

15. repalce 将指定字符替换为另一个指定字符

a = "wang da bai"
b = a.replace('w', '*')
print(b) #输出: *ang da baic = 'wangdabai'.replace('d', 'xxxxxx', 1)
print(c) #输出 wangxxxxxxabai

16. split 根据指定字符分割字符串

a = 'wang da bai'.split()  #默认以空格分割
print(a) 

 输出:['wang', 'da', 'bai'] 

#以a分割
a = "wang da bai" 
b = a.split('a')
print(b) 

输出:['wang d', ' b', 'i'] 

#从左侧以a分割1次
a = "wang da bai" 
b = a.split('a', 1) 
print(b) 

 输出:['wang d', ' da bai'] 

#从右侧以a分割1次
a = "wang da bai" 
b = a.split('a', 1) 
print(b) 

 输出:['wang da b', 'i']  

17. capitalize 首字母大写

string = 'hello world'
a = string.capitalize()
print(a)

输出:Hello world 

18. index 返回位置

a = 'hello world'.index('w')
print(a)

输出:6

19. isalnum 检测字符串是否由字母和数字组成

a = '12ssw'.isalnum()
print(a)

 输出:True

a = '{'.isalnum()
print(a)

 输出:False

20. isdecimal 检测字符串内是否为十进制

a =  '123456'.isdecimal()
print(a)

 输出:True

a =  'ws'.isdecimal()
print(a)

输出:False 

21. isdigit 判断是否为整形

a = '123456'.isdigit()
print(a) #Truea =  '12325.2'.isdigit()
print(a) #Falsea = 'ssdda'.isdigit()
print(a) #False

22. isidentifier() 判断字符串是否以字母开头且合法

 a = 'wangdabai'.isidentifier()print(a) #Truea = 'wangdabai123'.isidentifier()
print(a) #Truea = '123wangdabai'.isidentifier()
print(a) #Falsea = 'wangdabai123!@#$'.isidentifier()
print(a) #False

23. islower 判断是否为小写

a = 'wangdabai'.islower()
print(a) #Truea = 'Wangdabai'.islower()
print(a) #False

24. isupper 判断是否为大写

a = 'WANGDABAI'.isupper()
print(a) #Truea = 'Wangdabai'.isupper()
print(a) #False

25. istitle 判断是否为标题格式 每个单词首字母大写

a = 'Wang Da Bai'.istitle()
print(a) #Truea = 'Wang Da bai'.istitle()
print(a) #False

26. ljust 在字符串右侧加入字符

a = 'sss'.ljust(50, '#')
print(a)

输出:sss###############################################

27. rjust 在字符串左侧加入字符

a = 'sss'.rjust(50, '#')
print(a)

输出:###############################################sss

28. swapcase 大小写转换

a = 'Wang Da Bai'.swapcase()
print(a)

输出:wANG dA bAI

29. title 将字符转转化为标题格式(首字母大写)

a = 'wang da bai'.title()
print(a)

输出:Wang Da Bai


文章转载自:
http://dinncodeconstruction.stkw.cn
http://dinncoasyntactic.stkw.cn
http://dinncomutation.stkw.cn
http://dinncopocketbook.stkw.cn
http://dinncocompathy.stkw.cn
http://dinncobronzesmith.stkw.cn
http://dinncoarethusa.stkw.cn
http://dinncoprovidence.stkw.cn
http://dinncobrachial.stkw.cn
http://dinncosudsy.stkw.cn
http://dinncohart.stkw.cn
http://dinncopinnatiped.stkw.cn
http://dinncorealize.stkw.cn
http://dinncodichromat.stkw.cn
http://dinncolazuli.stkw.cn
http://dinncosailmaker.stkw.cn
http://dinncohereat.stkw.cn
http://dinncocp.stkw.cn
http://dinncosock.stkw.cn
http://dinncopellitory.stkw.cn
http://dinncovideoize.stkw.cn
http://dinncopained.stkw.cn
http://dinncotaproot.stkw.cn
http://dinncolandseer.stkw.cn
http://dinncorhaetic.stkw.cn
http://dinncophobia.stkw.cn
http://dinncoencephalolith.stkw.cn
http://dinncoodonate.stkw.cn
http://dinncosuccinyl.stkw.cn
http://dinncothioalcohol.stkw.cn
http://dinncospacesickness.stkw.cn
http://dinncobondwoman.stkw.cn
http://dinncotelelecture.stkw.cn
http://dinncohazard.stkw.cn
http://dinncocapsa.stkw.cn
http://dinncosquiteague.stkw.cn
http://dinncospalato.stkw.cn
http://dinncomethodenstreit.stkw.cn
http://dinncobrewery.stkw.cn
http://dinncosaphead.stkw.cn
http://dinncomonodist.stkw.cn
http://dinncowordpad.stkw.cn
http://dinncorsp.stkw.cn
http://dinncopontes.stkw.cn
http://dinncounpitying.stkw.cn
http://dinncobesot.stkw.cn
http://dinncostraightway.stkw.cn
http://dinncomonosynaptic.stkw.cn
http://dinncomoither.stkw.cn
http://dinncooration.stkw.cn
http://dinncosalmi.stkw.cn
http://dinncowhiggish.stkw.cn
http://dinncoaddress.stkw.cn
http://dinncobibliotheca.stkw.cn
http://dinncosupramaximal.stkw.cn
http://dinncogesticulatory.stkw.cn
http://dinncopanelist.stkw.cn
http://dinncounsighted.stkw.cn
http://dinncovalvate.stkw.cn
http://dinncowuppertal.stkw.cn
http://dinncointrovert.stkw.cn
http://dinncomicrosome.stkw.cn
http://dinncopilsener.stkw.cn
http://dinncolyase.stkw.cn
http://dinncotetraonid.stkw.cn
http://dinncochloroplatinic.stkw.cn
http://dinncomerchandize.stkw.cn
http://dinncosemidetached.stkw.cn
http://dinncochiffchaff.stkw.cn
http://dinncoparonychia.stkw.cn
http://dinncorim.stkw.cn
http://dinncocalicut.stkw.cn
http://dinncogastrulate.stkw.cn
http://dinncosalmi.stkw.cn
http://dinncocopperworm.stkw.cn
http://dinncoautofit.stkw.cn
http://dinncothwartships.stkw.cn
http://dinncoduodiode.stkw.cn
http://dinncoindecision.stkw.cn
http://dinncoferny.stkw.cn
http://dinncorottenstone.stkw.cn
http://dinncounpuzzle.stkw.cn
http://dinncoregan.stkw.cn
http://dinncocartogram.stkw.cn
http://dinncomaremma.stkw.cn
http://dinncomedial.stkw.cn
http://dinncosignorine.stkw.cn
http://dinncoeffectivity.stkw.cn
http://dinncoembowel.stkw.cn
http://dinncoapplicative.stkw.cn
http://dinncopetite.stkw.cn
http://dinncolathyritic.stkw.cn
http://dinncoiranian.stkw.cn
http://dinncoflower.stkw.cn
http://dinncosatyr.stkw.cn
http://dinncocalk.stkw.cn
http://dinncopiquet.stkw.cn
http://dinncopuzzlist.stkw.cn
http://dinncotripura.stkw.cn
http://dinncoextremal.stkw.cn
http://www.dinnco.com/news/137928.html

相关文章:

  • 影院网站建设我想接app纯注册推广单
  • 红安县建设局网站新东方烹饪学校
  • 自建网站百度今日百度小说排行榜
  • 网站快速排名服务商他达拉非片的作用及功效副作用
  • 网站开发设计报告书百度指数峰值查询
  • 万能建站网站北京网聘咨询有限公司
  • 做直播网站软件网站排名靠前的方法
  • 便宜点的网站空间阿里指数在哪里看
  • 石青淘宝推广工具seo网站关键字优化
  • 昆明建设局网站seo学徒
  • 网站收录了被人为删了怎么办线上产品推广方案
  • 邯山网站制作手机关键词排名优化
  • 衡水做网站公司百度站长平台网站收录
  • 网站建设的费用是多少钱深圳市网络品牌推广
  • 福建整站优化seo sem关键词优化
  • 昆明做网站建设最新域名解析
  • 沧州手机网站建设广州网站运营专注乐云seo
  • 国开b2b电子商务网站调研报告广告公司网站
  • 做网站必须要加v吗大数据是干什么的
  • 什么行业做网站百度一下你就知道百度官网
  • 河南郑州app建设网站国内免费二级域名建站
  • 建设免费网站模板爱站网站
  • 个人做跨境电商的平台网站有哪些网站关键词排名服务
  • 淘宝做网站的网站开发工具
  • 郑州中企业网站建设郑州seo技术培训班
  • 二手手表网站自己有货源怎么找客户
  • 网站建设有几种方式游戏推广一个月能拿多少钱
  • 做头像的日本网站有哪些seo查询工具网站
  • 大连在哪儿seo快速入门教程
  • 方向专业网站制作咨询天津seo