Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter check if string is number

bool isNumeric(String s) {
 if (s == null) {
   return false;
 }
 return double.tryParse(s) != null;
}
Comment

check if string is number dart

//From coflutter.com

bool isNumericUsingRegularExpression(String string) {
  final numericRegex = 
    RegExp(r'^-?(([0-9]*)|(([0-9]*).([0-9]*)))$');

  return numericRegex.hasMatch(string);
}
Comment

check if string contain number dart flutter

void main() {
  var stringArr = ["Hello world", "Hello1 World", "H23llo", "H00Elo", "World"];

  for (var i = 0; i < stringArr.length; i++) {
    bool found = stringArr[i].contains(new RegExp(r'[0-9]'));
    print(stringArr[i] + " -> " + found.toString());
  }
}
Comment

flutter check if string contains only number

final b = RegExp(r'^[0-9]+$').hasMatch(s);
Comment

PREVIOUS NEXT
Code Example
Dart :: Waiting for another flutter command to release the startup lock... 
Dart :: How to Create Number Inputfield in Flutter? 
Dart :: how to make a column scrollable in flutter 
Dart :: make a rounded container flutte 
Dart :: media query width flutter 
Dart :: text field make screen goes white flutter 
Dart :: dismiss keyboard flutter 
Dart :: flutter network image size 
Dart :: dart continue 
Dart :: detect os in flutter 
Dart :: flutter launcher icon generate 
Dart :: how to add padding flutter 
Dart :: flutter navigation pop 
Dart :: Round button with text and icon in flutter 
Dart :: send null icon flutter 
Dart :: close drawer flutter 
Dart :: flutter listview space between items 
Dart :: flutter firestore crud 
Dart :: flutter three line list 
Dart :: how to subtract dates in flutter 
Dart :: flutter main.dart 
Dart :: time difference flutter 
Dart :: remove status bar in flutter 
Dart :: text position in flutter 
Dart :: dart comments 
Dart :: change app bar height flutter 
Dart :: fix portrait oreintation flutter 
Dart :: todate format dart 
Dart :: flutter firebase personal user data 
Dart :: column remove space between flutter 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =