Notice: file_put_contents(): Write of 44 bytes failed with errno=28 No space left on device in /var/www/tgoop/post.php on line 50

Warning: file_put_contents(): Only 16384 of 16428 bytes written, possibly out of free disk space in /var/www/tgoop/post.php on line 50
Node.JS [ru] | Серверный JavaScript@we_use_js P.4285
WE_USE_JS Telegram 4285
👩‍💻 Чтение ввода и преобразование в верхний регистр

Напишите скрипт на Node.js, который читает строки из стандартного ввода и выводит их в верхнем регистре. Если пользователь вводит "exit", программа завершается.

Пример:

hello
HELLO
world
WORLD
exit


Решение задачи🔽

process.stdin.setEncoding('utf8');

process.stdin.on('data', (data) => {
const lines = data.trim().split('\n');
for (const line of lines) {
if (line.toLowerCase() === 'exit') {
process.exit(0);
} else {
console.log(line.toUpperCase());
}
}
});
Please open Telegram to view this post
VIEW IN TELEGRAM
👍32



tgoop.com/we_use_js/4285
Create:
Last Update:

👩‍💻 Чтение ввода и преобразование в верхний регистр

Напишите скрипт на Node.js, который читает строки из стандартного ввода и выводит их в верхнем регистре. Если пользователь вводит "exit", программа завершается.

Пример:

hello
HELLO
world
WORLD
exit


Решение задачи🔽

process.stdin.setEncoding('utf8');

process.stdin.on('data', (data) => {
const lines = data.trim().split('\n');
for (const line of lines) {
if (line.toLowerCase() === 'exit') {
process.exit(0);
} else {
console.log(line.toUpperCase());
}
}
});

BY Node.JS [ru] | Серверный JavaScript


Share with your friend now:
tgoop.com/we_use_js/4285

View MORE
Open in Telegram


Telegram News

Date: |

The group’s featured image is of a Pepe frog yelling, often referred to as the “REEEEEEE” meme. Pepe the Frog was created back in 2005 by Matt Furie and has since become an internet symbol for meme culture and “degen” culture. ZDNET RECOMMENDS You can invite up to 200 people from your contacts to join your channel as the next step. Select the users you want to add and click “Invite.” You can skip this step altogether. Add up to 50 administrators Ng Man-ho, a 27-year-old computer technician, was convicted last month of seven counts of incitement charges after he made use of the 100,000-member Chinese-language channel that he runs and manages to post "seditious messages," which had been shut down since August 2020.
from us


Telegram Node.JS [ru] | Серверный JavaScript
FROM American