operator * method - String class - dart:core library (original) (raw)
operator * abstract method
String operator *(
- int times )
Creates a new string by concatenating this string with itself a number of times.
The result of str * n
is equivalent tostr + str + ...
(n times)... + str
.
const string = 'Dart';
final multiplied = string * 3;
print(multiplied); // 'DartDartDart'
Returns an empty string if times
is zero or negative.
Implementation
String operator *(int times);