简述空串和空格串的区别.2.设s=’I AM A STUDENT’,t=’GOOD’,q=’WORKER’.求:(1) StrLength(s) (2) StrLength(t) (3) SubString(s,8,7) (4) SubString(t,2,1) (5) Index(s,‘A’) (6) Index(s,t) (7) Replace(s,‘STUDENT’,q) (8) Concat(SubString(s,6,2),Concat(t,SubString(s,7,8)))

问题描述:

简述空串和空格串的区别.2.设s=’I AM A STUDENT’,t=’GOOD’,q=’WORKER’.求:(1) StrLength(s) (2) StrLength(t) (3) SubString(s,8,7) (4) SubString(t,2,1) (5) Index(s,‘A’) (6) Index(s,t) (7) Replace(s,‘STUDENT’,q) (8) Concat(SubString(s,6,2),Concat(t,SubString(s,7,8)))

空格串表示只含空格的串.空串表示所含字符数为0的串.譬如说串" "是含两个空格的串,但他不是空串. 只需理解空格也是字符就行了