๐ Today ์์ฝ
1. match() ๋ฉ์๋ ๋ฌธ์์ด์ด ์ ๊ท์๊ณผ ๋งค์น๋๋ ๋ถ๋ถ์ ๊ฒ์ํ์ฌ [] ๋ฐฐ์ด๋ก ํํํด์ค๋ค
2. extends ํด๋์ค ํ์ฅ, ์ฌ์ ์ @override
3. git ๊ฐ์ ๋ฃ๊ธฐ sourcetree
๐ 1. ์ํ ์
[โ ] js ๋ณต์ต 2.1-2.6
[โ ] nomad js challenge (11/11)
[โ ] Lv0 ํ๋ก๊ทธ๋๋จธ์ค 2๋ฌธ์
[โ ]C.P dart 98-103
[โ ] nomad coder dart 4๊ฐ class ๋ณต์ต 4.0-4.10
[โ ] git ๊ฐ์ 3.1-3.9
โ๏ธ 2. ๊ฐ์ ์
- ์ค๊บพ๋ง.. !

๐ 3. ๋ฐฐ์ด ์
1. match()
str.match(regexp)
- regexp? ์ ๊ท์ ๊ฐ์ฒด
- ๋งค๊ฐ๋ณ์๋ฅผ ์ ๋ฌํ์ง ์๊ณ match()๋ฅผ ์ฌ์ฉํ๋ฉด ๋น ๋ฌธ์์ด ""์ด ์๋ ๋ฐฐ์ด์ด ๋ฐํ๋๋ค
- ๋ฌธ์์ด์ด ์ ๊ท์๊ณผ ์ผ์นํ๋ฉด, ์ผ์นํ๋ ์ ์ฒด ๋ฌธ์์ด์ ์ฒซ๋ฒ์งธ ์์๋ก ํฌํจํ๋ ๋ฐฐ์ด์ ๋ฐํํ ๋ค์ ๊ฒฐ๊ณผ๊ฐ ์จ๋ค
- ์ผ์นํ๋ ๊ฒ์ด ์์ผ๋ฉด Null ๋ฐํ
var str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
var regexp = /[A-E]/gi;
var matches_array = str.match(regexp);
console.log(matches_array);
// ['A', 'B', 'C', 'D', 'E', 'a', 'b', 'c', 'd', 'e']
var str = "Nothing will come of nothing.";
str.match(); // returns [""]
- ๊ธ๋ก๋ฒ(g) ๋ฐ ๋, ์๋ฌธ์ ๋ฌด์ (i) = gi
2. dart extends
- extends ํ์ ํด๋์ค๋ฅผ ๋ง๋ค๊ณ super ์์ ํด๋์ค ์ฐธ์กฐํ๋๋ฐ ์ฌ์ฉ
2-1 override
class Human {
final String name;
Human(this.name);
void sayHello() {
print("hi~ my name is $name");
}
}
enum Team { red, blue }
class Player extends Human {
Team team;
Player({required this.team, required String name}) : super(name);
@override
void sayHello() {
super.sayHello();
print("hihihih");
}
}
void main() {
var player = Player(team: Team.red, name: "์ด๋ฆ์ด๋ฆ");
player.sayHello();
}
- ์๋ธํด๋์ค๋ ์ธ์คํด์ค ๋ฉ์๋ (์ฐ์ฐ์ ํฌํจ) ๋ฑ์ ์ฌ์ ์ ํ ์ ์๋ค
- override๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ์ ์
3. abstract ์ถ์ ํด๋์ค
abstract class Null{
void update();
}
Extend a class
Learn how to create subclasses from a superclass.
dart.dev
'TIL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
20230426 TIL (0) | 2023.04.26 |
---|---|
20230420 TIL (0) | 2023.04.20 |
20230417 TIL (1) | 2023.04.17 |
20230414 TIL (0) | 2023.04.14 |
20230413 TIL (0) | 2023.04.14 |