Skip to content

Commit

Permalink
add createTag and isNumeric methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ksh-b committed Mar 10, 2024
1 parent 0050edd commit aaa4732
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/utils/string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,14 @@ String getAsSearchQuery(String category) {
}
return category;
}


String createTag(String inputString) {
RegExp specialChars = RegExp(r'[^\w\s]', multiLine: true);
String tag = inputString.replaceAll(specialChars, '').toLowerCase();
return tag;
}

bool isNumeric(String str) {
return double.tryParse(str) != null;
}

0 comments on commit aaa4732

Please sign in to comment.