def trim(s):
length=len(s)
if length>0:
if s[0]==' ':
s=s[1:length]
s=trim(s)
elif s[-1]==' ':
s=s[:length-1]
return s
Sign in to make a reply
yan32777
def trim(s):
length=len(s)
if length>0:
if s[0]==' ':
s=s[1:length]
s=trim(s)
elif s[-1]==' ':
s=s[:length-1]
s=trim(s)
return s