22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5- import " characters.dart" ;
6- import " grapheme_clusters/breaks.dart" ;
7- import " grapheme_clusters/constants.dart" ;
5+ import ' characters.dart' ;
6+ import ' grapheme_clusters/breaks.dart' ;
7+ import ' grapheme_clusters/constants.dart' ;
88import 'grapheme_clusters/table.dart' ;
99
1010/// The grapheme clusters of a string.
@@ -28,23 +28,23 @@ final class StringCharacters extends Iterable<String> implements Characters {
2828
2929 @override
3030 String get first => string.isEmpty
31- ? throw StateError (" No element" )
31+ ? throw StateError (' No element' )
3232 : string.substring (
3333 0 , Breaks (string, 0 , string.length, stateSoTNoBreak).nextBreak ());
3434
3535 @override
3636 String get last => string.isEmpty
37- ? throw StateError (" No element" )
37+ ? throw StateError (' No element' )
3838 : string.substring (
3939 BackBreaks (string, string.length, 0 , stateEoTNoBreak).nextBreak ());
4040
4141 @override
4242 String get single {
43- if (string.isEmpty) throw StateError (" No element" );
43+ if (string.isEmpty) throw StateError (' No element' );
4444 var firstEnd =
4545 Breaks (string, 0 , string.length, stateSoTNoBreak).nextBreak ();
4646 if (firstEnd == string.length) return string;
47- throw StateError (" Too many elements" );
47+ throw StateError (' Too many elements' );
4848 }
4949
5050 @override
@@ -74,9 +74,9 @@ final class StringCharacters extends Iterable<String> implements Characters {
7474 }
7575
7676 @override
77- String join ([String separator = "" ]) {
78- if (separator == "" ) return string;
79- return _explodeReplace (string, 0 , string.length, separator, "" );
77+ String join ([String separator = '' ]) {
78+ if (separator == '' ) return string;
79+ return _explodeReplace (string, 0 , string.length, separator, '' );
8080 }
8181
8282 @override
@@ -91,12 +91,12 @@ final class StringCharacters extends Iterable<String> implements Characters {
9191 cursor = next;
9292 }
9393 if (orElse != null ) return orElse ();
94- throw StateError (" No element" );
94+ throw StateError (' No element' );
9595 }
9696
9797 @override
9898 String elementAt (int index) {
99- RangeError .checkNotNegative (index, " index" );
99+ RangeError .checkNotNegative (index, ' index' );
100100 var count = 0 ;
101101 if (string.isNotEmpty) {
102102 var breaks = Breaks (string, 0 , string.length, stateSoTNoBreak);
@@ -108,7 +108,7 @@ final class StringCharacters extends Iterable<String> implements Characters {
108108 start = end;
109109 }
110110 }
111- throw RangeError .index (index, this , " index" , null , count);
111+ throw RangeError .index (index, this , ' index' , null , count);
112112 }
113113
114114 @override
@@ -209,7 +209,7 @@ final class StringCharacters extends Iterable<String> implements Characters {
209209
210210 @override
211211 Characters skip (int count) {
212- RangeError .checkNotNegative (count, " count" );
212+ RangeError .checkNotNegative (count, ' count' );
213213 return _skip (count);
214214 }
215215
@@ -221,7 +221,7 @@ final class StringCharacters extends Iterable<String> implements Characters {
221221
222222 @override
223223 Characters take (int count) {
224- RangeError .checkNotNegative (count, " count" );
224+ RangeError .checkNotNegative (count, ' count' );
225225 return _take (count);
226226 }
227227
@@ -233,9 +233,9 @@ final class StringCharacters extends Iterable<String> implements Characters {
233233
234234 @override
235235 Characters getRange (int start, [int ? end]) {
236- RangeError .checkNotNegative (start, " start" );
236+ RangeError .checkNotNegative (start, ' start' );
237237 if (end == null ) return _skip (start);
238- if (end < start) throw RangeError .range (end, start, null , " end" );
238+ if (end < start) throw RangeError .range (end, start, null , ' end' );
239239 if (end == start) return Characters .empty;
240240 if (start == 0 ) return _take (end);
241241 if (string.isEmpty) return this ;
@@ -254,10 +254,10 @@ final class StringCharacters extends Iterable<String> implements Characters {
254254 while (position > 0 ) {
255255 position-- ;
256256 start = breaks.nextBreak ();
257- if (start < 0 ) throw StateError (" No element" );
257+ if (start < 0 ) throw StateError (' No element' );
258258 }
259259 var end = breaks.nextBreak ();
260- if (end < 0 ) throw StateError (" No element" );
260+ if (end < 0 ) throw StateError (' No element' );
261261 if (start == 0 && end == string.length) return this ;
262262 return StringCharacters (string.substring (start, end));
263263 }
@@ -311,7 +311,7 @@ final class StringCharacters extends Iterable<String> implements Characters {
311311
312312 @override
313313 Characters skipLast (int count) {
314- RangeError .checkNotNegative (count, " count" );
314+ RangeError .checkNotNegative (count, ' count' );
315315 if (count == 0 ) return this ;
316316 if (string.isNotEmpty) {
317317 var breaks = BackBreaks (string, string.length, 0 , stateEoTNoBreak);
@@ -351,7 +351,7 @@ final class StringCharacters extends Iterable<String> implements Characters {
351351
352352 @override
353353 Characters takeLast (int count) {
354- RangeError .checkNotNegative (count, " count" );
354+ RangeError .checkNotNegative (count, ' count' );
355355 if (count == 0 ) return Characters .empty;
356356 if (string.isNotEmpty) {
357357 var breaks = BackBreaks (string, string.length, 0 , stateEoTNoBreak);
@@ -446,7 +446,7 @@ class StringCharacterRange implements CharacterRange {
446446 factory StringCharacterRange .at (String string, int startIndex,
447447 [int ? endIndex]) {
448448 RangeError .checkValidRange (
449- startIndex, endIndex, string.length, " startIndex" , " endIndex" );
449+ startIndex, endIndex, string.length, ' startIndex' , ' endIndex' );
450450 return _expandRange (string, startIndex, endIndex ?? startIndex);
451451 }
452452
@@ -513,7 +513,7 @@ class StringCharacterRange implements CharacterRange {
513513 _move (newStart, _end);
514514 return true ;
515515 } else {
516- throw RangeError .range (count, 0 , null , " count" );
516+ throw RangeError .range (count, 0 , null , ' count' );
517517 }
518518 }
519519
@@ -530,7 +530,7 @@ class StringCharacterRange implements CharacterRange {
530530 bool moveBack ([int count = 1 ]) => _retractStart (count, _start);
531531
532532 bool _retractStart (int count, int newEnd) {
533- RangeError .checkNotNegative (count, " count" );
533+ RangeError .checkNotNegative (count, ' count' );
534534 var breaks = _backBreaksFromStart ();
535535 var start = _start;
536536 while (count > 0 ) {
@@ -578,7 +578,7 @@ class StringCharacterRange implements CharacterRange {
578578
579579 @override
580580 bool dropFirst ([int count = 1 ]) {
581- RangeError .checkNotNegative (count, " count" );
581+ RangeError .checkNotNegative (count, ' count' );
582582 if (_start == _end) return count == 0 ;
583583 var breaks = Breaks (_string, _start, _end, stateSoTNoBreak);
584584 while (count > 0 ) {
@@ -636,7 +636,7 @@ class StringCharacterRange implements CharacterRange {
636636
637637 @override
638638 bool dropLast ([int count = 1 ]) {
639- RangeError .checkNotNegative (count, " count" );
639+ RangeError .checkNotNegative (count, ' count' );
640640 var breaks = BackBreaks (_string, _end, _start, stateEoTNoBreak);
641641 while (count > 0 ) {
642642 var nextBreak = breaks.nextBreak ();
0 commit comments