This repository has been archived on 2019-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2016-10-30 14:15:27 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace Galactic_Colors_Control_Common
|
|
|
|
|
{
|
|
|
|
|
public static class Common
|
|
|
|
|
{
|
2016-11-12 11:33:10 +00:00
|
|
|
|
public static string[] Strings(params string[] args)
|
|
|
|
|
{
|
|
|
|
|
return args;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string ArrayToString(string[] array)
|
|
|
|
|
{
|
|
|
|
|
string text = "";
|
|
|
|
|
if (array != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (string str in array)
|
|
|
|
|
{
|
|
|
|
|
text += (str + Environment.NewLine);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string ArrayToString(int[] array)
|
|
|
|
|
{
|
|
|
|
|
string text = "";
|
|
|
|
|
foreach (int i in array)
|
|
|
|
|
{
|
|
|
|
|
text += (i.ToString() + Environment.NewLine);
|
|
|
|
|
}
|
|
|
|
|
return text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string[] SplitArgs(string text)
|
|
|
|
|
{
|
|
|
|
|
return text.Split('"')
|
|
|
|
|
.Select((element, index) => index % 2 == 0
|
|
|
|
|
? element.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
: new string[] { element })
|
|
|
|
|
.SelectMany(element => element).ToArray();
|
|
|
|
|
}
|
2016-10-30 14:15:27 +00:00
|
|
|
|
}
|
2016-11-12 11:33:10 +00:00
|
|
|
|
}
|