using System;
using System.Text.RegularExpressions;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
// Name: Clear Blank Lines
// Description:Clears white space (spaces and tabs) from any line that ONLY contains white space. Optionally removes the empty lines too.
bool bolRemoveEmptyLines = true; // Removes empty lines
text = Regex.Replace(text, @"^[ \t]+(?[\r\n]{1,2})+", "${linebreak}", RegexOptions.Multiline);
if (bolRemoveEmptyLines) {
text = Regex.Replace(text, @"([\r\n]{1,2})+", "\r\n", RegexOptions.Multiline);
}
MacroAPI.PasteText(text); // Optional. Pastes the text straight away. Useful when a HotKey is used.
return text;
}
}