Discuss / Python / 短一点

短一点

Topic source

¤

#1 Created at ... [Delete] [Delete and Lock User]
def trim(s):
	if len(s)>0:
		if s[-1]==" ":
			s=s[:-2]
		if s[0]==" ":
			s=s[2:]
	return s

  • 1

Reply