How can I remove the first line of a multi-line string?

wxjmfauth at gmail.com wxjmfauth at gmail.com
Wed Dec 16 03:50:52 EST 2015


>>> s = """abc
... αβγ
... абв"""
>>> i = 0
>>> ns = ''
>>> while i < len(s):
... if s[i] == '\n':
... break
... i += 1
... 
>>> i += 1
>>> while i < len(s):
... ns += s[i]
... i += 1
... 
>>> print(ns)
αβγ
абв


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /