mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
15 lines
424 B
Dart
15 lines
424 B
Dart
extension StringExtension on String {
|
|
int? getItemId() {
|
|
final RegExp regex = RegExp(r'\d+$');
|
|
final String match = regex.stringMatch(this) ?? '';
|
|
return int.tryParse(match);
|
|
}
|
|
|
|
String removeAllEmojis() {
|
|
final RegExp regex = RegExp(
|
|
r'(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])',
|
|
);
|
|
return replaceAllMapped(regex, (_) => '');
|
|
}
|
|
}
|