[chronojump/michrolab] AddArrayString moved from util.cs to utilAll.cs



commit 3a794d9a5f2e8616839238c3fb499dadb11d9df5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Aug 2 14:54:21 2022 +0200

    AddArrayString moved from util.cs to utilAll.cs

 src/util.cs    | 16 ++++------------
 src/utilAll.cs | 14 ++++++++++++++
 2 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/src/util.cs b/src/util.cs
index 5b8a145a3..38290f0dd 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1953,7 +1953,7 @@ public class Util
                return TrimDecimals(myLimitedWithoutLetter, pDN) + myLimitedLetter;
        }
 
-       public static string [] AddToArrayString(string [] initialString, List<string> add_l)
+       public static string [] AddToArrayString (string [] initialString, List<string> add_l)
        {
                string [] returnString = new string[initialString.Length + add_l.Count];
                int i, j;
@@ -1965,21 +1965,13 @@ public class Util
                return returnString;
        }
 
-       public static string [] AddArrayString(string [] initialString, string [] addString)
+       public static string [] AddArrayString (string [] initialString, string [] addString)
        {
-               string [] returnString = new string[initialString.Length + addString.Length];
-               int i;
-               int j;
-               for (i=0 ; i < initialString.Length; i ++)
-                       returnString[i] = initialString[i];
-               for (j=0 ; j < addString.Length; j ++)
-                       returnString[i+j] = addString[j];
-
-               return returnString;
+               return UtilAll.AddArrayString (initialString, addString);
        }
 
        //bool firstOrLast: true means first
-       public static string [] AddArrayString(string [] initialString, string addString, bool firstOrLast)
+       public static string [] AddArrayString (string [] initialString, string addString, bool firstOrLast)
        {
                string [] returnString = new string[initialString.Length + 1];
 
diff --git a/src/utilAll.cs b/src/utilAll.cs
index e27844cbf..e1f3f6694 100644
--- a/src/utilAll.cs
+++ b/src/utilAll.cs
@@ -231,5 +231,19 @@ public class UtilAll
                return Convert.ToInt32(DivideSafe(val1, val2));
        }
 
+       //here to be able to be called from chronojumpMini
+       public static string [] AddArrayString(string [] initialString, string [] addString)
+       {
+               string [] returnString = new string[initialString.Length + addString.Length];
+               int i;
+               int j;
+               for (i=0 ; i < initialString.Length; i ++)
+                       returnString[i] = initialString[i];
+               for (j=0 ; j < addString.Length; j ++)
+                       returnString[i+j] = addString[j];
+
+               return returnString;
+       }
+
 
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]