You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
296 B
14 lines
296 B
3 years ago
|
extension NumberPrefix on String {
|
||
|
String get numberPrefix {
|
||
|
final sb = StringBuffer();
|
||
|
for (final c in this.runes) {
|
||
|
if ('0'.runes.first <= c && c <= '9'.runes.first) {
|
||
|
sb.writeCharCode(c);
|
||
|
}
|
||
|
else {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
return sb.toString();
|
||
|
}
|
||
|
}
|