Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generating string

 
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
Marshal
Pie
Posts: 21194
81
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
Pie
Posts: 20546
57
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic