Created
February 7, 2023 13:50
-
-
Save LokieVikky/0f4868d8b41bea6ae553f034df0cb76d to your computer and use it in GitHub Desktop.
This file contains 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() { | |
// String topics | |
// length | |
// substring | |
// split | |
// replace | |
// isEmpty | |
// isNotEmpty | |
// contains | |
// compare | |
// indexOf | |
// toLower | |
// toUpper | |
// trim - left, right | |
// concat | |
// interpolation | |
// escaping string | |
// // List declaration - type safe | |
// List<String> mobNumbers = []; | |
// // adding to list | |
// mobNumbers.add('asdfsdfasdf'); | |
// // removing from string | |
// mobNumbers.remove('asdfsdfasdf'); | |
// printing first value | |
// print(mobNumbers[0]); | |
// printing first value | |
// print(mobNumbers.first); | |
// List values = []; | |
// values.add(1); | |
// values.add("0"); | |
// values.add(true); | |
// print(values); | |
List values2 = []; | |
values2.add(1); | |
values2.add("0"); | |
values2.add(true); | |
// int b = int.parse(values[1]); | |
// int? a = int.tryParse(values[1]); | |
// print(values.join(',')); | |
// values.addAll(values2); | |
// print(values); | |
// add | |
// remove | |
// removeat | |
// clear | |
// sublist | |
// indexOf | |
// join | |
// fold | |
// expand | |
// elementAt | |
// addAll | |
// asMap | |
// Map declaration | |
Map map = { | |
'key1': 'val1', | |
'key2': 'val2', | |
}; | |
//use key to Update or add values | |
map['key1'] = 'Val3'; | |
map['key3'] = 'val4'; | |
print(map); | |
List<Map> listOfMap = []; | |
listOfMap.add({'f': 'val'}); | |
// Map declaration - type safe | |
Map<String, String> stringMap = {}; | |
Map<String, dynamic> jsonMap = {}; | |
// keys | |
// values | |
// clear | |
// contains key | |
// contains values | |
// addAll | |
// remove | |
// putIfAbsent | |
List<String> data = ['0']; | |
List<String> data2 = ['0']; | |
print(data.hashCode); | |
print(data2.hashCode); | |
print(data == data2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment