Created
March 13, 2022 13:46
-
-
Save Deleplace/9bbfce9e4f4e21436a19655e1278d4d7 to your computer and use it in GitHub Desktop.
Check if set contains a value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
var x = new Set<String>(); | |
x.add("foo"); | |
{ | |
var e = "foo"; | |
var b = x.contains(e); | |
print('x contains ${e}: ${b}'); | |
} | |
{ | |
var e = "barbaz"; | |
var b = x.contains(e); | |
print('x contains ${e}: ${b}'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment