ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/gr2lib/trunk/gr2lib/core/helpers/arraytostring.cs
Revision: 67
Committed: Thu Jul 15 09:28:34 2010 UTC (12 years, 1 month ago) by william
File size: 737 byte(s)
Log Message:
Add class to convert an array to a string

File Contents

# User Rev Content
1 william 67 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     }