Skip to content

Commit 343c227

Browse files
authored
Merge pull request #6 from lkrjangid1/main
Add Some code snippts
2 parents 5fa0375 + 1805ada commit 343c227

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
void main() {
2+
final text = """My website url: https://blasanka.github.io/
3+
Google search using: www.google.com, social media is facebook.com, http://example.com/method?param=flutter
4+
stackoverflow.com is my greatest website. DartPad share: https://github.com/dart-lang/dart-pad/wiki/Sharing-Guide see this example and edit it here https://dartpad.dev/3d547fa15849f9794b7dbb8627499b00""";
5+
6+
RegExp exp = new RegExp(r'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+');
7+
Iterable<RegExpMatch> matches = exp.allMatches(text);
8+
9+
matches.forEach((match) {
10+
print(text.substring(match.start, match.end));
11+
});
12+
}

TableInDart.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Table(
2+
border: TableBorder.all(), // Allows to add a border decoration around your table
3+
children: [
4+
TableRow(children :[
5+
Text('Year'),
6+
Text('Lang'),
7+
Text('Author'),
8+
]),
9+
TableRow(children :[
10+
Text('2011',),
11+
Text('Dart'),
12+
Text('Lars Bak'),
13+
]),
14+
TableRow(children :[
15+
Text('1996'),
16+
Text('Java'),
17+
Text('James Gosling'),
18+
]),
19+
]
20+
),

find # tag in a string.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
void main() {
2+
String strWithNum = """
3+
Hubble is hiring!
4+
5+
Hubble is looking for a Community Manager to join their talented team.
6+
7+
💻 Community Manager
8+
🌍 Remote
9+
🕒 Contract, Full-Time, Part-Time
10+
11+
Apply now 👇cryptocurrencyjobs.co/customer-suppo... #blockchainjobs #cryptojobs
12+
""";
13+
List a = strWithNum.split(' ');
14+
for(var x in a){
15+
if(x[0].startsWith(RegExp(r'#'))){
16+
print(x);
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)