题目如下:
The following SAS program is submitted:
data work.test;
First='Ipswich, England';
City=substr(First,1,7);
City_Country=City!!', '!!'England';
run;
Which one of the following is the value of the variable CITY_COUNTRY in the output data set?
A. Ipswich!!
B. Ipswich, England
C. Ipswich, 'England'
D. Ipswich , England
Answer: D
这道题我是这么认为的:substr截取了First变量的前7个字符后,因为字符型变量的默认长度为8,又是left-aligned,所以City的值为‘Ipswich ’,然后选择D。但是看到有网友解释说City的长度和First一样为16,就有点搞不懂了~~~
不知道我自己的想法是否正确呢~亦或是其他的解释~
求教各位大神啦~~~