summaryrefslogtreecommitdiff
path: root/Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-06-28 09:40:37 +0800
committerchai <chaifix@163.com>2022-06-28 09:40:37 +0800
commit49b25e755b70ec412feaaf0b898d6f7e09d2bea6 (patch)
tree3c5f4260f30d1c2d7196db93153700d7ddec3157 /Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs
parentc92269331692feca2c276649f6c4ee8911f1f859 (diff)
+node example
Diffstat (limited to 'Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs')
-rw-r--r--Other/NodeEditorExamples/Assets/UNEB/Utility/StringExtensions.cs29
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