locked
Delete the new lines(blank rows) in the code RRS feed

  • Question

  • User-1200513740 posted

    How can i delete blank lines in my code?

    Any shortcuts?Please suggest.  I don't want to allow blank spaces between code lines.

    //below is my code

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace nodeChains
    {
    public class Node
    {
    public int Value { get; set; }


    public Node Next { get; set; }
    }
    class Program
    {
    static void Main(string[] args)
    {
    Node _first = new Node { Value = 3 }; //first node

    Node _middle = new Node { Value = 5 }; // Second Node
    _first.Next = _middle;//1st chain


    Node last = new Node { Value = 7 }; //Third Node
    _middle.Next = last;// 2nd chain

    middle.Next = last;// 2nd chain
    }
    private static void PrintList(Node node)
    {
    while (node != null)

    while (node != null)
    {
    Console.WriteLine(node.Value);
    node = node.Next;
    }
    }
    }

    }

    Friday, September 9, 2016 3:19 PM

Answers

  • User-2057865890 posted

    Hi Ravichandrareddypolice,

    How can i delete blank lines in my code?

    Any shortcuts?Please suggest.  I don't want to allow blank spaces between code lines.

    1. Press " Ctrl+ H ".
    2. Tick "Use Regular Expressions"
    3. In Find specify ^\r\n
    4. In Replace box delete everything.
    5. Click "Replace All"

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 12, 2016 7:00 AM