1. Java equivalent to VB 'string' function (create string with repeating characters)?
Hi,
Is there an equivalent in Java to the VB 'string' function, which
creates a string of 'x' repeating characters?
For instance, something like:
String s = vbEquivString("x", 6); // yields s = "xxxxxx"
Thanks,
Jim
2. Java equivalent to VB 'string' function (create string with repeating characters)? - Java
3. A string composed of a character repeated x number of times
In Java, what function/method do we have for constructing composed of a single character repeated x number of times. I am looking for the .NET equivalant of this String class constructor: public String(char c, int numTimesToRepeat); I looked at the java.lang.String class' constructors and couldn't find one that matched my needs.
4. Create a string with (n) copies of the same character
I'm looking for an easy way to repeat a character.
For example in Perl if you want 5 "x"'s the code is
$str = "x" x 5; # result xxxxx
I've tried a few ways in javascript to accomplish this, but can not
come up with anything other then the lame old basic way which is
probably more processing then required...
var str = "";
for (var i = 0; 5 > i; i++){
str += "x";
}
Any better solutions?
6. Javascript: filter repeating character...
7. adding characters like character 253, 254 to javascript strings
Hi, Convert the character to hex and build the string as: str = '\xFD\xFE'; as \xHEXCODEHERE regards, Elias