summaryrefslogtreecommitdiff
path: root/Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs
blob: 33c0d9606621d9eb0e84b128c0051affafeed64a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

namespace UNEB
{
    public static class StringExtensions
    {

        /// <summary>
        /// Merges the parent and child paths with the '/' character.
        /// </summary>
        /// <param name="parentDir"></param>
        /// <param name="childDir"></param>
        /// <returns></returns>
        public static string Dir(this string parentDir, string childDir)
        {
            return parentDir + '/' + childDir;
        }

        /// <summary>
        /// Appends the extension to the file name with '.'
        /// </summary>
        /// <param name="file"></param>
        /// <param name="extension"></param>
        /// <returns></returns>
        public static string Ext(this string file, string extension)
        {
            return file + '.' + extension;
        }
    }
}