Skip to content

Instantly share code, notes, and snippets.

@internetova
Last active November 20, 2020 18:58
Show Gist options
  • Save internetova/0dfa80194ca60440ae8e1215fe14eb1f to your computer and use it in GitHub Desktop.
Save internetova/0dfa80194ca60440ae8e1215fe14eb1f to your computer and use it in GitHub Desktop.
// 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