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.
|
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(); |
|
} |
|
} |