多做题,通过考试没问题!

数据结构

睦霖题库>大学试题(计算机科学)>数据结构

已知字符串:a=“an apple”,b=“other hero”,c=“her”,求:  (1)concat(substr(a,1,2),b)。  (2)replace(a,substr(a,5,1),c)。  (3)index(a,c)和index(b,c)。

正确答案:(1)返回值为“another hero”,其中substr(a,1,2)的返回值为“an”。
(2)返回值为“an aherherle”,其中sub(a,5,1)的返回值为“p”。
(3)返回值分别为0和3。
答案解析:
进入题库查看解析

微信扫一扫手机做题