By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,798 Members | 1,766 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,798 IT Pros & Developers. It's quick & easy.

Replace a character in a string.

P: n/a
Greetings,

I got a string like this str = {1234-4543-6453-ACBD-AFEB} now i need to have
an output like str = 1234-4543-6453-ACBD-AFEB, basically i want to remove
the characters
'{' and '}'.

here is the code....

vector<string> Temp;

//Fill the elements in Temp
........................
.........................

//Read the elements from Temp

for (int l = 0; l < Temp.size(); ++l)
{
std::string str= Temp[l].c_str();

}
Now str outputs the values with character '{' and '}' i need it to output
values without these characters.
Pl Help.
Regards,
Venkat


Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Venkat" <ve*******@yahoo.com> wrote in message
news:1071469855.463813@sj-nntpcache-5...
Greetings,

I got a string like this str = {1234-4543-6453-ACBD-AFEB} now i need to have an output like str = 1234-4543-6453-ACBD-AFEB, basically i want to remove
the characters
'{' and '}'.

here is the code....

vector<string> Temp;

//Fill the elements in Temp
.......................
........................

//Read the elements from Temp

for (int l = 0; l < Temp.size(); ++l)
{
std::string str= Temp[l].c_str();

}
Now str outputs the values with character '{' and '}' i need it to output
values without these characters.
Pl Help.
Regards,
Venkat


std::string newstr = s.substr(1, s.length()-2);

--
Elias
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.