From b411aa2128c2724bec0ecedb8cb4e1ffa59f3b53 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Wed, 26 Sep 2018 20:51:37 +0200 Subject: disconnected most vital calles from the Discord Bot --- DSACore/Auxiliary/Extensions.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 DSACore/Auxiliary/Extensions.cs (limited to 'DSACore/Auxiliary/Extensions.cs') 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; + } + } + +} -- cgit v1.2.3-54-g00ecf