Using .find and .replace with strings
Ok here is my homework assignment... I have it working for some instances but not for others.
Here is the code that does the conversion..
Essentially i have a string like... C++ is awesome!
it must convert C++ to java.
then it converts all letters to Uppercase
I have it working with there is one instance of C++, however if there is none or more than one it will not work proper. Im figured i need to do some kind of loop that goes through checking for C++ and changing it if it finds it .... not sure how exactly to do that
modified = original;
pos = original.find("C++");
upperStr = modified;
int i = 0;
if (modified[i] == ' ' || modified[i] == ',' || modified[i] == '.')
upperStr[i] = modified[i];
if (modified[i] >= 65 && modified[i] <= 90)
upperStr[i] = modified[i] + 32;
if (modified[i] >= 97 && modified[i] <= 122)
upperStr[i] = modified[i] - 32;