SAS中的剔除空格函数

left函数:         刪除字符串左边(开头> 的空格
right函数:       刪除字符串右边(结尾> 的空格
trim函数:         刪除字符串右边(结尾> 的空格
strip函数:        刪除字符串前后空格
compress函数:删除字符串中所有空格
compbl函数:    将连续两个或以上的空格压缩为1个空格

例如:

data test; 
x=' 123    456    ';
strl='a'|lleft(x)||'b'; 
str2='a'||right(x)||'b'; 
str3='a'||trim(x)||'b'; 
str4='a'||strip(x)||'b'; 
str5='a'||compress(x)||'b';
str6='a'||compbl(x)||'b'; 
run;
proc print;
run;
原文地址:https://www.cnblogs.com/huangbiquan/p/8007618.html