This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Dim Dioannou wrote:I want to find a word in a text file and then to take a part of it and to
save it in a String.
for example I have this part of text
and when I find the word ''xmlns:'' I want to take the word after : till =
(rdf in this case) and to put it in a string.
All the approaches suggested so far are horribly brittle. It's perfectly possible for the XML to change in various valid ways that would break your code. Regexps simply are not capable of dealing with that. If you're handling XML, you need to use XML/DOM APIs.