Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to connect two string with a line break??  (Read 2531 times)

0 Members and 1 Guest are viewing this topic.

linuxyf

    Topic Starter


    Rookie

    How to connect two string with a line break??
    « on: July 07, 2008, 01:16:40 AM »
    @echo off
    set str1=this is line 1
    set str2=this is line 2

    rem how to write following code???
    set str3= ?????

    echo %str3%
    pause



    the result is:
    this is line1
    this is line2


    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: How to connect two string with a line break??
    « Reply #1 on: July 07, 2008, 03:57:21 AM »
    Code: [Select]
    @echo off
    set str1=this is line 1
    set str2=this is line 2
    echo %str1% && echo %str2%

    By concatenating the two echo commands, you effectively insert the carriage return line feed characters.

     8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    linuxyf

      Topic Starter


      Rookie

      Re: How to connect two string with a line break??
      « Reply #2 on: July 07, 2008, 06:21:49 PM »
      thank you very much!