I have tried both the String method 'replace' and StringTokenizer. As the segments of my strings is of unknown length I guess StringTokenizer is out of question. I also need to go through several strings (with many similar segments to replace in each string). I have assumed there is a command for finding substrings something like "begin with..., and end with..." but have not found any.

As I am new to programming, this case might be simple for all but me...

Can you post an example? What does the strings look like?
–
martinrJan 17 '10 at 21:45

Typically a hierarchical "tree" like below (Aaa:11.111,(Bbbb:2.222,Cc:3.33)666:4.44)777.77:5; Where I for ex want to replace everything between ')' and ':' with one the same thing, for ex 'n'.
–
EvoManganJan 17 '10 at 22:05

Click edit to make any changes in the question as the comment doesn't support any formatting and try to accept correct answers by clicking "Tick mark" to the left of answer.
–
Tech JerkJan 18 '10 at 5:07