using System.Linq;
public class C
{
public static string FirstName(string fullName)
{
return fullName.Split(' ').First();
}
}
public class C
{
public static string CommaSeparated(object[] range)
{
return string.Join(", ", range);
}
}
using System.Linq;
public class C
{
public static int DistinctCount(object[,] range)
{
return (from string s in range select s).Distinct().Count();
}
}
public class C
{
public static bool IsLeapYear(int year)
{
return System.DateTime.IsLeapYear(year);
}
public static int CountIfFunc(object[,] range, string functionName)
{
dynamic xlApp = ExcelDna.Integration.ExcelDnaUtil.Application;
int result = 0;
foreach(var i in range)
{
if(xlApp.Run(functionName, i))
++result;
}
return result;
}
}
public class C
{
public static bool RegexIsMatch(string input, string pattern)
{
return System.Text.RegularExpressions.Regex.IsMatch(input, pattern);
}
}
public class C
{
[ExcelDna.Integration.ExcelFunction("Returns the full name of a person")]
public static string ESharperFullName(
[ExcelDna.Integration.ExcelArgument("First name")] string fname,
[ExcelDna.Integration.ExcelArgument("Last name")] string lname)
{
return fname + " " + lname;
}
}
To show help as you type, install Excel-DNA IntelliSense add-in:
Copyright 2008 - 2024 Vlasov Studio (Best in class Visual Studio extensions and tools)