lstrip : 去掉首空格
rstrip : 去掉尾空格
gsub : 去掉全部空格,不过要用到pattern匹配
ruby 去掉字符串中的空格
猜你喜欢
转载自www.cnblogs.com/lv-books/p/12784467.html
今日推荐
周排行