1. <source id="nejs2"></source>
  2. <video id="nejs2"></video>
    <source id="nejs2"></source>
          1. Python lstrip()

            更新:

            python 中的lstrip()函數根據給定的參數刪除原始字符串副本中的前導字符。方法將此副本作為輸出返回。

             **string.lstrip([chars])** #where chars are those to remove as leading characters 
            

            lstrip()參數:

            函數的作用是:以字符為參數。如果未提供字符,則從字符串中刪除前導空格。

            參數 描述 必需/可選
            燒焦 要作為前導字符移除的字符 可選擇的

            lstrip()返回值

            返回值始終是字符串。在找到第一個匹配之前,所有字符組合都從左邊開始刪除。

            | 投入 | 返回值 | | 線 | 字符串的副本 |

            Python 中lstrip()方法的示例

            示例lstrip()在 Python 中是如何工作的?

             # Variable declaration  
            string1 =  "  Python  "  
            # Leading whitepsace are removed
            print(string1.lstrip()) 
            string2 =  ",,,,,ssaaww.....programming" 
            print(string2.lstrip(",.asw")) 
            

            輸出:

             Python  
            programming 

            例 2:伊斯特普的工作

             # Variable declaration  
            string1 =  "$$$$-Python-$$$$"  
            # Calling function  
            string2 = string1.lstrip('$')  
            # Displaying result  
            print(string1)  
            print(string2) 
            

            輸出:

             $$$$-Python-$$$$
            -Python-$$$$ 
            頂部 久久久久99精品成人片毛片_黃色A片三級三級三級无码_日本不卡高清视频v中文字幕_高清欧美视频一区二区
            1. <source id="nejs2"></source>
            2. <video id="nejs2"></video>
              <source id="nejs2"></source>