Skip to content
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

Closed
DartBot opened this issue Sep 25, 2012 · 11 comments
Closed

String should have a repeat method #5427

DartBot opened this issue Sep 25, 2012 · 11 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Sep 25, 2012

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/

@lrhn
Copy link
Member

lrhn commented Sep 25, 2012

Not unreasonable, but no promises.
It could reasonably be operator*.


Set owner to @lrhn.
Added this to the M2 milestone.
Removed Type-Defect label.
Added Type-Enhancement, Area-Library, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Sep 25, 2012

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.

@lrhn
Copy link
Member

lrhn commented Oct 8, 2012

Not that the implementation should probably be different for single-character strings and longer strings - the JS engines have optimizations for the simple cases.
Q.v. http://jsfiddle.net/GejWV/41/

@floitschG
Copy link
Contributor

Removed this from the M2 milestone.
Added this to the M3 milestone.

@anders-sandholm
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the M4 milestone.

@larsbak
Copy link

larsbak commented May 28, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@kasperl
Copy link

kasperl commented Jun 4, 2014

Removed this from the M5 milestone.
Added this to the 1.6 milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@DartBot
Copy link
Author

DartBot commented Oct 17, 2014

This comment was originally written by davidm...@google.com


This can be closed?

@lrhn
Copy link
Member

lrhn commented Oct 17, 2014

Absolutely! Good catch.


Added Fixed label.

@DartBot DartBot added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Oct 17, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants