• Post Reply Bookmark Topic Watch Topic
  • New Topic

generating string  RSS feed

 
Puneet N Vyas
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abcabdabeabfacdaceacfadeadfaefbcdbcebcfbdebdfbefcdecdfcefdef

consider the above set of strings generated, now i am iterating over the collection containing these strings, now i need to modify each of the string,for example: string abc should be changed to:
a([^ b]*)b([^ c]*)c
similarly other string has to be modified like above,can any one how to do this.

thanks for support
 
Henry Wong
author
Sheriff
Posts: 23283
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks pretty straightforward. What have you tried so far?

Henry
 
Rob Spoor
Sheriff
Posts: 21095
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

That should also handle longer strings. Only if the string is empty this code will throw an ArrayIndexOutOfBoundsException.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!