diff options
author | 2011-02-23 22:21:52 +0000 | |
---|---|---|
committer | 2011-02-23 22:21:52 +0000 | |
commit | 547dbaec94fac399b24cfd4ac56557379ab556a0 (patch) | |
tree | ec9d466fa41a14a288621403d392e2649e9c1933 /Source/Core/Util.cs | |
parent | 398377309c2d242c1ecac7a3efaa981ab892ae30 (diff) |
Add IEnumerable.Concat1 method.
Diffstat (limited to 'Source/Core/Util.cs')
-rw-r--r-- | Source/Core/Util.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/Util.cs b/Source/Core/Util.cs index d0d8693a..d557bc55 100644 --- a/Source/Core/Util.cs +++ b/Source/Core/Util.cs @@ -27,6 +27,14 @@ namespace Microsoft.Boogie { return sb.ToString();
}
+ public static IEnumerable<T> Concat1<T>(this IEnumerable<T> objects, T final)
+ {
+ foreach (var s in objects) {
+ yield return s;
+ }
+ yield return final;
+ }
+
public static string MapConcat<T>(this IEnumerable<T> objects, Func<T,string> toString, string separator)
{
var sb = new StringBuilder();
|