if i want to print perticular string multiple no. of times .
if i want to print perticular string multiple no. of times . and if that number is varies dyanamically then how to do it ?
while(x.find()&& !m.find()){
int last=x.end();
int first= x.start();
int indx=last-first;
p.println("Last index is " +last);
p.println("first index is " +first);
String trg=targetSegment.replaceAll(ReGeX," ");// here i am stuck ..
I want to replace as many no. of times as that indx variable value is ..
How to do that
plzzzzz help
it did not work .. i need
If index is 5 then it should replace (string * 5) times
if index id 10 then it should replace (string * 10) times
How to achieve this ?
Say suppose if index is 2 then it should print "amitamit" that means two times amit .. Noe if index is 3 then it should print "amitamitamit" that means 3 times amit is printed ..
Like that i want according to index value printing of perticular string should change
Help plzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
> Say suppose if index is 2 then it should print
> "amitamit" that means two times amit .. Noe if index
> is 3 then it should print "amitamitamit" that means 3
> times amit is printed ..
> Like that i want according to index value printing
> of perticular string should change
>
> Help plzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
First: stop signing your post with that crap! We know you need help: that's why you're posting here.
Now your question: ok, you would like to print a certain string a number of times. Could you provide some sample in- and (desired) output because I have no idea by looking at the code from your original post what it is you're trying to do.
Also, please explain what this is supposed to do: while(x.find()&& !m.find())
Amit, meet StringBuilder. StringBuilder, this is Amit. I think you'll get along just fine. If you need anything else, please consult someone called "for loop".