设有A=“” B===“mule” C=“old” D=“my” 试计算下列运算的结果(注:
问题详情
设有A=“”,B===“mule”,C=“old”,D=“my”,试计算下列运算的结果(注:A+B是CONCAT(A,B)的简写)。 (1)A+B; (2)B+A; (3)D+C+B; (4)SubStr(B,3,2); (5)SubStr(C,1,0); (6)StrLen(A); (7)StrLen(D); (8)Index(B,D); (9)Index(C,“d”); (10)Insert(D,2,C); (11)Insert(B,1,A); (12)StrDel(B,2,2); (13)StrDel(B,2,O); (14)StrReplace(C,2,2,“k”)。
请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:(1)A+B=“#mule”(2)B+A=“mule”(3)D+C+B“myoldmule”(4)SubStr(B32)=“le”(5)SubStr(C10)=“”(6)StrLen(A)=1(7)StrLen(D)=2(8)Index(BD)=0(9)Index(C“d”)=3(10)Insert(D2C)=“myldy”(11)Insert(B1A)=“m#ule”(12)StrDel(B22)“me”(13)StrDeI(B20)=“mule”(14)StrReplace(C22“k”)=“ok”
A+B=“#mule”(2)B+A=“mule”(3)D+C+B“myoldmule”(4)SubStr(B,3,2)=“le”(5)SubStr(C,1,0)=“”(6)StrLen(A)=1(7)StrLen(D)=2(8)Index(B,D)=0(9)Index(C,“d”)=3(10)Insert(D,2,C)=“myldy”(11)Insert(B,1,A)=“m#ule”(12)StrDel(B,2,2)“me”(13)StrDeI(B,2,0)=“mule”(14)StrReplace(C,2,2,“k”)=“ok”