Repeat string to certain length
What is an efficient way to repeat a string to a certain length? Eg: repeat(‘abc’, 7) -> ‘abcabca’ Here is my current code: … Read more
What is an efficient way to repeat a string to a certain length? Eg: repeat(‘abc’, 7) -> ‘abcabca’ Here is my current code: … Read more
In Python, where [2] is a list, the following code gives this output: [2] * 5 # Outputs: [2,2,2,2,2] Does there exist an … Read more
In Perl I can repeat a character multiple times using the syntax: $a = “a” x 10; // results in “aaaaaaaaaa” Is there … Read more