Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

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());
  }
}
Source by www.codevscolor.com #
 
PREVIOUS NEXT
Tagged: #check #string #number #dart #flutter
ADD COMMENT
Topic
Name
6+3 =