summaryrefslogtreecommitdiff
path: root/DSACore/Auxiliary/Extensions.cs
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-09-26 20:51:37 +0200
committerTrueDoctor <d-kobert@web.de>2018-09-26 20:51:37 +0200
commitb411aa2128c2724bec0ecedb8cb4e1ffa59f3b53 (patch)
tree14e0a0cca2cf66b95fda402c8c7d7b6bd5b7b222 /DSACore/Auxiliary/Extensions.cs
parent92e8bb7523c775014ccf68355e3f0178ebf4a61c (diff)
disconnected most vital calles from the Discord Bot
Diffstat (limited to 'DSACore/Auxiliary/Extensions.cs')
-rw-r--r--DSACore/Auxiliary/Extensions.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/DSACore/Auxiliary/Extensions.cs b/DSACore/Auxiliary/Extensions.cs
new file mode 100644
index 0000000..8ef6298
--- /dev/null
+++ b/DSACore/Auxiliary/Extensions.cs
@@ -0,0 +1,33 @@
+namespace DSACore.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;
+ }
+
+
+
+ //This mehod extends string.
+ //It adds spaces at the HEAD of a string until a fixed length is reached.
+ //If the original string is already longer, it is returner unmodified.
+ public static string AddSpacesAtHead(this string str, int length)
+ {
+ string temp = "";
+ for (int i = str.Length; i < length; i++)
+ {
+ temp += " ";
+ }
+ return temp + str;
+ }
+ }
+
+}