實現php中trim函數,去掉字符串收尾的空格php
def trim(s):函數
if s[0:1] != '' and s[-1:] != '':字符串
return stest
elif s[0:1] != '':im
return trim(s[1:])字符
else:return
return trim(s[:-1])
print(trim(' jyl test ')