Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

Unique Values by Line

Description
Takes a list of values and returns only the unique values in the list. The unique value list is placed in the clipboard.
Language
C#.net
Minimum Version
Created By
wooster11
Contributors
-
Date Created
Aug 19, 2014
Date Last Modified
Aug 19, 2014

Macro Code

using System;
using System.Collections.Generic;

public static class ClipboardFusionHelper
{
    public static string ProcessText(string text)
    {
        System.IO.StringReader sr = new System.IO.StringReader(text);
      string line = null;
      List<string> values = new List<string>();

        line = sr.ReadLine();
      while (line != null)
        {
          if (!values.Contains(line)) values.Add(line);
            line = sr.ReadLine();
        }

      return String.Join("\n", values.ToArray());
    }
}