/[gr2lib]/trunk/gr2lib/core/helpers/arraytostring.cs
ViewVC logotype

Contents of /trunk/gr2lib/core/helpers/arraytostring.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 67 - (show annotations) (download)
Thu Jul 15 09:28:34 2010 UTC (10 years, 9 months ago) by william
File size: 737 byte(s)
Add class to convert an array to a string
1 using System;
2 using System.Collections.Generic;
3 using System.Collections;
4 using System.Text;
5
6 namespace gr2lib.core.helpers
7 {
8 /// <summary>
9 /// Converts an array to a string representation
10 /// </summary>
11 /// <typeparam name="E">Element Type</typeparam>
12 /// <typeparam name="T">Array Type</typeparam>
13 public class arraytostring<E, A> where A : IEnumerable<E>
14 {
15 private string _array_string = "";
16 public arraytostring(A array) { int i = 0; foreach (E e in array) { if (i == 0) { _array_string = _array_string + e.ToString(); } else { _array_string = _array_string + " " + e.ToString(); } i++; } }
17 public override string ToString() { return _array_string; }
18 }
19 }

  ViewVC Help
Powered by ViewVC 1.1.22