We have several lines of text:

чтобы сделать перевод строки, просто добавьте два пробела в конец строки чтобы добавить код программы, предварите его четырьмя пробелами основные HTML тэги также поддерживаются 

We need to replace the first two lines from here. How to do it?

Those. to make it like this:

 замена основные HTML тэги также поддерживаются 

    1 answer 1

    Javascript:

      var afterText = string.split("\n").splice(2); result = preText + "\n" + afterText.join("\n"); // где preText - строка заменяющая первые 2 // string - базовая строка 

    PHP:

      $lines = explode("\n", $string); $afterTextArray = array_splice( $lines, 2 ); $result = $preText . "\n" . implode( $afterTextArray ); // где $preText - текст замены // $string - базовая строка 

    PS: what is the question is the answer = \

    • If you write in detail, then no one answers. Therefore, briefly and wrote. Here is a more detailed question: hashcode.ru/questions/81157/… ... - nick777
    • one
      I mean, the question is elementary and they are rightly doing what they do not answer. What would you like? Ready code? The algorithm is described, all you need is to write your function. If there are any more specific questions - ask, I will be happy to help, if not - learn the mat.part and come after. - Zowie
    • In general, I gave an answer to your question, but the fact that your previous one doesn’t answer "as it were" hints that the question from the category "do it for me, and I will put a plus! 11! ADZIN! 1!" - Zowie
    • What is the problem? How much should I pay for your answer? - nick777