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.
StringTokenizer or String.split() will split a string on some delimiter. You could replaceAll() commas with spaces and use a space delimiter to process the words one at a time:
Try that and see how it works. Then we can talk about regular expressions. If you don't know them they are significantly trickier and could "capture" all the text between "select" and "from" and probably even capture one word at a time.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Sep 08, 2005
thanks for yr input i will defi try that
but for time bieng i did as follow --------------****************--------------------------- int pos = str.indexOf( "select"); int pos1 = str.indexOf( "from"); String str1 = str.substring(6,pos1);