New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String should have a repeat method #5427
Comments
Not unreasonable, but no promises. Set owner to @lrhn. |
This comment was originally written by @butlermatt I like the repeat method for strings, but not sure I agree with the * operator. For the same reason + doesn't concatenate two strings, I think using a * operator to repeat a string would confuse even more than the '+' behaviour. Personally I would prefer a .repeat(x) method. |
Not that the implementation should probably be different for single-character strings and longer strings - the JS engines have optimizations for the simple cases. |
Removed this from the 1.6 milestone. |
Removed Oldschool-Milestone-1.6 label. |
This comment was originally written by davidm...@google.com This can be closed? |
Absolutely! Good catch. Added Fixed label. |
This issue was originally filed by naddis...@gmail.com
Dart's string should have a repeat method like python's str * int and perl's 'x' operator.
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Version 0.1.0.201209240906, build 12784
Dart SDK version 12783
Please provide any additional information below.
Possible implementation details: http://jsfiddle.net/disfated/GejWV/
The text was updated successfully, but these errors were encountered: