注册 登录
编程论坛 C++教室

求助

cwlcwl 发布于 2008-04-06 18:43, 450 次点击
string中的设置如何使用(replace(0,9,9,'c'))
2 回复
#2
zjl1382008-04-06 19:13
不明白你说什么,i am sorry........
#3
sunkaidong2008-04-06 19:27
basic_string& replace(size_type p0, size_type n0,
    const E *s);
basic_string& replace(size_type p0, size_type n0,
    const E *s, size_type n);
basic_string& replace(size_type p0, size_type n0,
    const basic_string& str);
basic_string& replace(size_type p0, size_type n0,
    const basic_string& str, size_type pos, size_type n);
basic_string& replace(size_type p0, size_type n0,
    size_type n, E c);
basic_string& replace(iterator first0, iterator last0,
    const E *s);
basic_string& replace(iterator first0, iterator last0,
    const E *s, size_type n);
basic_string& replace(iterator first0, iterator last0,
    const basic_string& str);
basic_string& replace(iterator first0, iterator last0,
    size_type n, E c);
basic_string& replace(iterator first0, iterator last0,
    const_iterator first, const_iterator last);
Each member function replaces up to n0 elements of the controlled sequence beginning with position p0, or the elements of the controlled sequence beginning with the one pointed to by first, up to but not including last. The replacement is the operand sequence specified by the remaining operands. The function then returns *this.
1