Last active
November 20, 2020 18:58
-
-
Save internetova/0dfa80194ca60440ae8e1215fe14eb1f to your computer and use it in GitHub Desktop.
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
// 1 Задание 1(void) | |
// Создайте текстовую переменную a = ‘hello world’; Напишите функцию, без возвращаемого значения. | |
// Функция меняет порядок слов на обратный. Например было ‘hello world’, стало ‘world hello’. | |
void main() { | |
var a = 'hello world'; | |
var b = 'Функция меняет порядок слов на обратный'; | |
reverceText(a); | |
reverceText(b); | |
} | |
void reverceText(String text) { | |
text = text.split(' ').reversed.join(' '); | |
print(text); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment