Answer the question
In order to leave comments, you need to log in
In what direction to solve the Algorithmic problem?
When applying for an internship as a JS developer, they are required to solve such a problem, I can’t understand what form the answer should be in general? Should I write a function where the code is replaced using the replace method or what? The question is not for the sake of getting a ready-made solution, I just want to know in which direction I should move, there are 10 such tasks.
Write a program that converts the message text into HTML.
Input data format
The input file contains from 1 to 100 lines of no more than 100 characters, containing the message text.
Output data format Output the
input text to the output file after replacing the specified BB-codes with HTML-codes.
For example:
Input data - [b][b][/b]
Output - [b] tag b in html (for some reason the code itself disappears when the question is posted)
Answer the question
In order to leave comments, you need to log in
Should I write a function where the code is replaced using the replace method or what?
Write a program
[b][b][/b] --> [b]<b></b>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question