diff options
Diffstat (limited to 'Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs')
-rw-r--r-- | Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs b/Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs new file mode 100644 index 00000000..33c0d960 --- /dev/null +++ b/Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs @@ -0,0 +1,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; + } + } +}
\ No newline at end of file |