From ff80592d541c79653ef0a7c04e0938d7249069ef Mon Sep 17 00:00:00 2001 From: Kobert-P Date: Mon, 11 Jun 2018 16:49:40 +0200 Subject: Neu: !list held + !list waffe Verbesserung --- DiscoBot/Auxiliary/Extensions.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'DiscoBot/Auxiliary/Extensions.cs') diff --git a/DiscoBot/Auxiliary/Extensions.cs b/DiscoBot/Auxiliary/Extensions.cs index 2176129..a1d58fa 100644 --- a/DiscoBot/Auxiliary/Extensions.cs +++ b/DiscoBot/Auxiliary/Extensions.cs @@ -13,5 +13,20 @@ } 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-70-g09d2