| | |
Help:find repeating substrings in sting
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2008
Posts: 3,844
Reputation:
Solved Threads: 503
I think I might know what you are asking, but I am not sure and thus it would only be a guess. Please phrase your question more clearly.
if I'm not mistaken, you want to declare a String, containing several substrings, separated by an espace. after this, you would like to find the longest of those substrings.
one option could be, storing the String in a StringBuffer, setting the space as a token, and check where the difference is the longest between two tokens, and comparing that with the first string (between begin of substring and first token) and the last one (between the last token and the end of the StringBuffer)
one option could be, storing the String in a StringBuffer, setting the space as a token, and check where the difference is the longest between two tokens, and comparing that with the first string (between begin of substring and first token) and the last one (between the last token and the end of the StringBuffer)
•
•
Join Date: Jun 2007
Posts: 59
Reputation:
Solved Threads: 3
•
•
•
•
Hi,
How to find out the repeating substrings in a string which is having maximum characters.
eg : abc abcd a abc abcd
Answer : abcd
Sorry, thought you were searching only for repeating substrings... I have missed the maximum length thing...
Last edited by Chaster; Aug 25th, 2008 at 6:10 pm.
![]() |
Other Threads in the Java Forum
- Previous Thread: Unable to locate image file
- Next Thread: What is the code for exponent in java?
Views: 1687 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool linux list loop map method methods mobile netbeans newbie number object oracle os pong print problem producer program programming project projectideas read recursion reflection replaysolutions rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows






