Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 help with changing portions of a word
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
scottyrush13




PostPosted: Fri Feb 24, 2006 8:46 am   Post subject: help with changing portions of a word

We are supposed to make a program now that reads a line of text that the user inputs, and then change the spelling of words that end in 'or' to end in 'our'.

I searched through my book and the only thing I can find that changes spelling of words is

String s2=s1.replace ('*','*')

(s2 and s1 of course being the string variables, and * representing the letter you want to change with what you want it changed to).

However this doesn't work for changing multiple letters, like or to our, and I don't know how to make it change ONLY the words that END in or.

Any help that someone could offer would be very appreciated.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Fri Feb 24, 2006 12:58 pm   Post subject: (No subject)

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

Have you looked at all of the methods that have "replace" in their name?
scottyrush13




PostPosted: Wed Mar 01, 2006 8:58 am   Post subject: (No subject)

Embarassed
Thank woo wtd!

Sorry for the lengthy wait for my response. I've been...catching up on alot of stuff.

Anyways, I'll be sure the search more thoroughly through my other resources before coming on to here to bug you people. Very Happy Laughing Wink
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: