aspose file tools*
The moose likes Beginning Java and the fly likes I am new and need help with this plzzzzzzzzzzz Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I am new and need help with this plzzzzzzzzzzz" Watch "I am new and need help with this plzzzzzzzzzzz" New topic
Author

I am new and need help with this plzzzzzzzzzzz

John Mcrae
Greenhorn

Joined: May 05, 2004
Posts: 2
Hi, I am new to Java programming language. And I need some help. I want to make a program, that will Capitalize the first letter of each word in input. For example if the input is, "now is the time to act" , the output should be "Now Is The Time To Act". That will be of great help.
Also if you can give me a code for a program that will replace a String with another string. For example there should be three inputs. First input should be a sentence. The second input should be a part from words in the first sentence. The third input should be a different word. For example, if the first input is, "I like playing basketball" and the second input is "basketball", and the third input is "soccer". The out put should be, "I like soccer". So it replaces the second input with the third.
Can anyone help me plzzzzzzzzz, send replies here, or to my e-mail: home_work3@hotmail.com its urgent plzzzzzzzz
Thank you
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Hi John Mcrae,
As discussed many times in this forum that please don't try to submit your home works and assignment here. Try to write the code yourself and if you face any problem in that then you are welcome to post that here. I am not trying to discourage you but nobody has much time to do you assignments.
Anyhow you can use String class's methods to replace the strings and do other functions. like there is substr() function which searches for the specific substring inside the string and return the starting index of that substring. there is also a replace() method. So first see the String class. You can see from http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html. After that write the code yourself and if you face any problem regarding that submit your question. You will difinately get an answer.
John Mcrae
Greenhorn

Joined: May 05, 2004
Posts: 2
Thats what I have so far:

I dont know how to save the first word in a separate place and the remainder of word in another. Can you help me here plz z
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ May 06, 2004: Message edited by: Dirk Schreckmann ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, John!
As suggested by Ali, you'll likely want to become very comfortable with harvesting all of the great information in the API documentation.
You might find a method described in the Character class documentation that converts lower case letters to upper case letters to be useful.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I am new and need help with this plzzzzzzzzzzz