Don't know about a built-in method. I'd make a repeatChar method like
this:
public static String repeatChar(char a, int numTimes){
StringBuffer p = new StringBuffer();
for (int i = 0; i<numTimes; i++) p.append(a);
return p.toString();
}
Tommy
On Jun 25, 2:07 am, Al Catraz <[email protected]> wrote:
> I am seeking the Java-built-in method == if such exists.. THNX
>
> On Jun 24, 10:20 am, Al Catraz <[email protected]> wrote:
>
> > I am seeking the method to construct a string from a repeat of a char
> > n times
>
> > something like
>
> > String s = repeatChar("*", 8); \\ will return a
> > string = "********"
>
> > Is there such a method?
>
> > Thanks
>
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---