[Vala] Extension Methods
- From: Uwe Strempel <u strempel googlemail com>
- To: vala-list gnome org
- Subject: [Vala] Extension Methods
- Date: Thu, 5 Mar 2009 20:10:54 +0100
Hi,
is there any feature like extension methods from c# 3.0 in vala supported.
It would be a cool feature in vala and could allow to write better code.
namespace ExtensionMethods
{
public static class MyExtensions
{
public static int WordCount(this String str)
{
return str.Split(new char[] { ' ', '.', '?' }, StringSplitOptions.RemoveEmptyEntries).Length;
}
}
}
(see http://msdn.microsoft.com/en-us/library/bb383977.aspx)
thanks,
regards
uwe
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]