473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

i need to get the but now in the quotes , every time i compile it i get this( but now str4 = "i love a country life in montana")

*/
cout << "===========================================\n ";
cout << ">>>>> My code below ... >>>>>\n";
cout << "===========================================\n ";

string str4 ("I used to love a country life in Montana!");" \n";
cout << "str4: " << inDoubleQuote(str4) << "\n";

cout << "\n>>> Find and erase \"used to \" ...\n";
pos = str4.find("used to");
str4.erase(pos,7 );
cout << "str4: " << inDoubleQuote(str4) << "\n";

cout << "\n>>> After str4 = \"But now \" + str4 ...\n";
cout << "But now "; <== need help here
cout << "str4: " << inDoubleQuote(str4) << "\n";

cout << "\n>>> Find \"a country\" and replace it with \"an urban\" ...\n";
pos = str4.find("a country");
str4.replace(pos, 8, "an urban");
cout << "str4: " << inDoubleQuote(str4) << "\n";

cout << "\n>>> Find \"Montana\" and replace it with \"Chicago\" ...\n";
pos = str4.find("Montana");
cout << "str4: " << inDoubleQuote(str4) << "\n";

cout << endl;
}
Mar 15 '22 #1
0 685

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Megha Vishwanath | last post by:
Hi, We have an application where my clients may be at different timezones. I need to validate time across the timezones with javascript. The date object in JavaScript does not allow me to get...
0
by: Chad | last post by:
I have COM component embedded on html page. It has version 1.0.0.1 (by default). I have converted it in cab file. Code of html is something like: <HTML><HEAD></HEAD><BODY><OBJECT...
8
by: Scott M | last post by:
I have a procedure in my Dispose method that records my application was closed in a database. However, when I kill a process or an unhandled exception occurs this does not seem to run. Is there...
3
by: vijaykokate | last post by:
Our company http://www.softnmation.com/ offers its customers a great variety of products. Everything you need can be found in this site. Web Template, CSS Template, Logo Template, Corporate...
7
by: yonatnl | last post by:
why In every time I pressing Ctrl + Shift + B, Visual Studio Compiles The solution? I Did not changed a thing in the Code. It was Ok 2 days a Go... and After getting Latest Version from the...
2
by: jdecock | last post by:
I have a solution with a couple different websites and another project that creates a .dll needed by those sites. Until about a week or two ago I wasn't having any problems, but recently it has...
6
by: Bill | last post by:
Hi all, How would I set up a script to run every time a user comes to a page (even if they come to the page via the back button)? Thanks! Bill
1
by: yuva | last post by:
"Thank you for this amazing program. Within a weekend, my team increased with 50 new people joining. Every time I logged on there was a new affiliate. Absolutely amazing. " S. Horvath SOUTH AFRICA...
4
by: Frank Lund | last post by:
Should we call .Dispose() every chance we get... on every object that exposes .Dispose()... and every time we have such an object? For example, is it true that *every* time I create a DataTable...
1
by: kieran04 | last post by:
every time i run this program in VBE i keep getting the message 'Compile Error: expected array' for the two bold lines underneath, please help? Public Function KnotsToKmPerHr(knots As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.