String contains () dart code example
Example 1: flutter string contains
var string = 'Dart strings';
string.contains('D'); // true
//You can use Regex to find patterns inside a string
string.contains(new RegExp(r'[A-Z]')); // true
Example 2: dart contains method
void main(){
var x = "This is a string.";
var y = "a";
var match = x.contains(y);
print(match);
}