Removing first x characters from string?

前端 未结 5 719
轻奢々
轻奢々 2020-12-23 02:36

How might one remove the first x characters from a string? For example, if one had a string lipsum, how would they remove the first 3 characters and get a resul

5条回答
  •  旧巷少年郎
    2020-12-23 03:08

    >>> text = 'lipsum'
    >>> text[3:]
    'sum'
    

    See the official documentation on strings for more information and this SO answer for a concise summary of the notation.

提交回复
热议问题