def trim(str): len1 = len(str) - 1 i = 0 t = len1 firstFlat = True endFlat = True while len1>=i: if firstFlat and ' '== str[i:i+1]: i = i+1 if endFlat and ' '==str[len1:len1+1]: t = t -1 len1 = len1 -1 return str[i:t+1]
Sign in to make a reply
用户5646817530