zoukankan      html  css  js  c++  java
  • 数据类型—字符串

    字符串:

                     字符串是一个有序字符的集合,用于存储和表示基本的文本信息

    字符串的切片:

         a = 'red blue"

         a.count("e")

    >>>2

        a.count("e",2,7)

    >>>0

    strip

    a = "                alex                    "

    a.strip()

    replace 

    a = " my score is 580 "

    a.replace("580","630")

    查:find      index      count

    删:字符串不可变,不能删除

    改:replace    upper    lower   casefold     swapcase   strip    split 

    格式化: format    rjust   ljust   join 

    判断:  isdigital   startwith   endwith 

  • 相关阅读:
    3.16
    3.8
    3.7
    3.6
    3.5
    3.3
    3.2
    《机器学习十讲》学习报告一
    机器学习-集成算法
    机器学习-基于核的算法
  • 原文地址:https://www.cnblogs.com/jiajin-wu/p/11729951.html
Copyright © 2011-2022 走看看