Replacing a word in a string with the given word

Hi Everyone...

Need your Help. I don't want to use any pr defined functions to perform the following task...

For Example : I have a Sting "This is my World" now i want to search a word say "my" and replace it with some other word. Like "your"

so my final string should look some thing like this " This is Your World"

I don want to use any of the predefined functions. I hope my question is clear.

Hope to get the answer at the earliest.

Thanks and regards

-Atul Saxena

[518 byte] By [Atul_Saxenaa] at [2007-11-26 18:55:35]
«« Sessions
»» Session
# 1
So you want to write your own replaceAll method?You will need to iterate through the String, find the item you want to replace, then create a new String with the content replaced. What part are you having problems with?
zadoka at 2007-7-9 20:33:56 > top of Java-index,Java Essentials,Java Programming...
# 2
> I don want to use any of the predefined functions. I> hope my question is clear.> Impossible! You have to use a predefined method to get chars from the string or to convert the string to a char arrays or to use replace or substring.
sabre150a at 2007-7-9 20:33:56 > top of Java-index,Java Essentials,Java Programming...
# 3
Hi,Thanks for the reply.I am not getting the logic to write the code.
Atul_Saxenaa at 2007-7-9 20:33:56 > top of Java-index,Java Essentials,Java Programming...
# 4
> Hi,Thanks for the reply.I am not getting the logic> to write the code.I would suggest you try to work it out on paper what you are trying to do. Then think about the code.Also, you might want to address sabre150's reply and clarify your requirements.
zadoka at 2007-7-9 20:33:56 > top of Java-index,Java Essentials,Java Programming...