新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python中isprintable判斷字符的使用
說明

成都創(chuàng)新互聯(lián)專注于企業(yè)網(wǎng)絡營銷推廣、網(wǎng)站重做改版、云陽網(wǎng)站定制設計、自適應品牌網(wǎng)站建設、HTML5、商城網(wǎng)站開發(fā)、集團公司官網(wǎng)建設、外貿網(wǎng)站建設、高端網(wǎng)站制作、響應式網(wǎng)頁設計等建站業(yè)務,價格優(yōu)惠性價比高,為云陽等各大城市提供網(wǎng)站開發(fā)制作服務。
1、判斷字符是否為可打印字符。isprintable()用于判斷字符串中的所有字符是否為空。
Unicode字符集中在Other和Separator類別中的字符是不可打印的字符(但不包括ASCII碼中的空格(0x20)。
2、isprintable()可以用來判斷轉義字符。
實例
str1 = '\n\t' print(str1.isprintable()) # False str1 = 'mr_soft' print(str1.isprintable()) # True str1 = '12345' print(str1.isprintable()) # True str1 = '蜘蛛俠' print(str1.isprintable()) # True
以上就是python中isprintable判斷字符的使用,希望對大家有所幫助。更多Python學習指路:創(chuàng)新互聯(lián)python教程
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
當前文章:創(chuàng)新互聯(lián)Python教程:python中isprintable判斷字符的使用
新聞來源:http://m.5511xx.com/article/cdpcesi.html


咨詢
建站咨詢
