Dart String Manipulations: Strings Validations
Jeet Bhalu
1 min read
Strings validation :
- In dart string validation is check to your string field email is correct or incorrect email a email is correct to your answer is true and email is not correct to answer is false in String filed is checked
Example:
void main() {
String userInput;
userInput = "Hello@email.com";
// String isVaild = "example@gmail.com";
// false
print(userInput);
String isEmail;
if (userInput.contains("@")) {
isEmail = 'true';
} else {
isEmail = 'false';
}
print(isEmail);
}
Output:
Hello@email.com
true
0
Subscribe to my newsletter
Read articles from Jeet Bhalu directly inside your inbox. Subscribe to the newsletter, and don't miss out.
String validationstringvalidationlearn dart Dart String Manipulations: Strings ValidationsDart#dart language#dart-for-beginnersdart programming tutorial#dart-keywords#JeetbhaluJeet BhalujeetFlutterProgramming BlogsTutorial
Written by
Jeet Bhalu
Jeet Bhalu
i am Jeet Bhalu i am flutter App developer