Dart removeLastを使ってリストの最後の値を削除する

環境
OS windows10 Home 64bit
Dart 2.18.4

構文
リスト名.removeLast()
removeLastを使って最後の値を削除します。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
void main() {
var cft = ['study', 'skill', 'smart'];
print(cft.removeLast());
print(cft);
}
void main() { var cft = ['study', 'skill', 'smart']; print(cft.removeLast()); print(cft); }
void main() {
  
 var cft = ['study', 'skill', 'smart'];

  print(cft.removeLast()); 

  print(cft); 
}

実行結果
smart
[study, skill]

Dart

Posted by arkgame