summaryrefslogtreecommitdiff
path: root/DiscoBot/Auxiliary/Extensions.cs
blob: 2176129be87d3ac20b4386fc46ba477340cbfad1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
namespace DiscoBot.Auxiliary
{
    public static class StringExtension
    {
        //This mehod extends string. It adds spaces until a fixed length is reached.
        //If the original string is already longer, it is returner unmodified.
        public static string AddSpaces(this string str, int length)
        {
            string temp = str;
        for(int i = str.Length; i < length; i++)
            {
                temp += " ";
            }
            return temp;
        }
    }
}