summaryrefslogtreecommitdiff
path: root/DiscoBot/Auxiliary/Extensions.cs
diff options
context:
space:
mode:
authorKobert-P <kassiaK@yahoo.de>2018-06-10 01:17:57 +0200
committerKobert-P <kassiaK@yahoo.de>2018-06-10 01:17:57 +0200
commit19fd05a2990ec309a3869d61a6bcf48aba4793dd (patch)
tree32f1f6dc38bb70db678bf190369ae66a12d4e6d2 /DiscoBot/Auxiliary/Extensions.cs
parentae507064b9b0dc29d72f02b1ff3d7560bd38a89f (diff)
AddSpaces extension
Diffstat (limited to 'DiscoBot/Auxiliary/Extensions.cs')
-rw-r--r--DiscoBot/Auxiliary/Extensions.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/DiscoBot/Auxiliary/Extensions.cs b/DiscoBot/Auxiliary/Extensions.cs
new file mode 100644
index 0000000..2176129
--- /dev/null
+++ b/DiscoBot/Auxiliary/Extensions.cs
@@ -0,0 +1,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;
+ }
+ }
+}