第30448题 单选题
以下关于C++ std::string类常见成员函数的使用,说法正确的是?

假设所有代码均已正确引入std命名空间且编译环境符合C++11及以上标准

A

std::string s = "hello"; s.substr(1, 3)的返回值为字符串"ell"

B

std::string s = "hello world"; s.find("a")的返回值为0

C

std::string s = "abc"; s.append(2, 'd', 'e')执行后s的值为"abcdde"

D

std::string s = "test"; s.erase(2)执行后s的值为"tet"

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析